From 7f0994d65017e743c648343ea6a200ef8a42012c Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sun, 12 Jan 2025 19:41:43 +0000 Subject: [PATCH] [Java] Update auto-generated bindings to LDK 0.1.0 --- .../org/ldk/enums/Bolt12SemanticError.java | 35 +- .../org/ldk/enums/PaymentFailureReason.java | 18 +- .../org/ldk/enums/RetryableSendFailure.java | 5 +- src/main/java/org/ldk/impl/bindings.java | 2249 ++-- src/main/java/org/ldk/structs/APIError.java | 2 +- .../java/org/ldk/structs/AcceptChannelV2.java | 4 +- src/main/java/org/ldk/structs/Amount.java | 2 +- .../org/ldk/structs/AsyncPaymentsContext.java | 125 + .../structs/AsyncPaymentsMessageHandler.java | 23 +- .../ldk/structs/Bolt11InvoiceDescription.java | 126 + .../ldk/structs/Bolt11InvoiceParameters.java | 185 + .../org/ldk/structs/Bolt11ParseError.java | 402 +- .../java/org/ldk/structs/Bolt12Invoice.java | 57 +- .../ldk/structs/Bolt12InvoiceFeatures.java | 34 + .../java/org/ldk/structs/ChannelDetails.java | 53 +- src/main/java/org/ldk/structs/ChannelId.java | 9 - .../java/org/ldk/structs/ChannelManager.java | 308 +- .../ldk/structs/ChannelManagerReadArgs.java | 39 +- .../ldk/structs/ChannelMessageHandler.java | 26 + .../java/org/ldk/structs/ChannelMonitor.java | 29 +- .../org/ldk/structs/ChannelMonitorUpdate.java | 16 +- .../java/org/ldk/structs/ChannelSigner.java | 53 +- .../structs/CommonAcceptChannelFields.java | 3 +- .../ldk/structs/CommonOpenChannelFields.java | 3 +- .../org/ldk/structs/DNSResolverContext.java | 130 + .../org/ldk/structs/DNSResolverMessage.java | 163 + .../structs/DNSResolverMessageHandler.java | 167 + .../java/org/ldk/structs/DNSSECProof.java | 94 + .../java/org/ldk/structs/DNSSECQuery.java | 70 + .../java/org/ldk/structs/DecodeError.java | 2 +- .../java/org/ldk/structs/DefaultRouter.java | 19 +- .../java/org/ldk/structs/Description.java | 11 + .../org/ldk/structs/EcdsaChannelSigner.java | 131 +- src/main/java/org/ldk/structs/Event.java | 112 +- .../java/org/ldk/structs/ExpandedKey.java | 52 +- .../java/org/ldk/structs/FilesystemStore.java | 13 + .../org/ldk/structs/FinalOnionHopData.java | 17 + .../java/org/ldk/structs/FutureCallback.java | 7 +- .../org/ldk/structs/HeldHtlcAvailable.java | 23 +- .../org/ldk/structs/HumanReadableName.java | 143 + .../ldk/structs/IgnoringMessageHandler.java | 13 + .../org/ldk/structs/InboundChannelFunds.java | 112 + .../java/org/ldk/structs/InitFeatures.java | 34 + .../java/org/ldk/structs/InvoiceRequest.java | 74 +- .../org/ldk/structs/InvoiceRequestFields.java | 42 +- ...WithDerivedPayerSigningPubkeyBuilder.java} | 36 +- ...oiceRequestWithExplicitPayerIdBuilder.java | 143 - ...voiceWithExplicitSigningPubkeyBuilder.java | 3 +- .../java/org/ldk/structs/MessageContext.java | 61 + .../org/ldk/structs/MigratableKVStore.java | 93 + .../java/org/ldk/structs/MonitorName.java | 79 + .../java/org/ldk/structs/NetworkGraph.java | 8 +- .../java/org/ldk/structs/NodeFeatures.java | 68 + src/main/java/org/ldk/structs/NodeSigner.java | 71 +- src/main/java/org/ldk/structs/Nonce.java | 4 +- .../java/org/ldk/structs/OMNameResolver.java | 122 + src/main/java/org/ldk/structs/Offer.java | 86 +- .../OfferWithDerivedMetadataBuilder.java | 8 +- .../OfferWithExplicitMetadataBuilder.java | 10 +- .../java/org/ldk/structs/OffersContext.java | 26 +- .../java/org/ldk/structs/OnionMessenger.java | 18 +- .../java/org/ldk/structs/OpenChannelV2.java | 4 +- ...anReadableNameThirtyTwoBytesZZOfferZZ.java | 96 + ...umanReadableNameThirtyTwoBytesZZStrZZ.java | 96 + ...SResolverMessageResponseInstructionZZ.java | 96 + .../Option_C2Tuple_PublicKeyChannelIdZZ.java | 96 + .../org/ldk/structs/ParseOrSemanticError.java | 2 +- .../structs/ParsedOnionMessageContents.java | 28 + .../java/org/ldk/structs/PaymentContext.java | 28 - .../java/org/ldk/structs/PaymentPurpose.java | 4 + .../org/ldk/structs/PaymentSendFailure.java | 278 - .../java/org/ldk/structs/PeerManager.java | 7 +- .../org/ldk/structs/PendingHTLCRouting.java | 12 +- src/main/java/org/ldk/structs/Persist.java | 14 + .../org/ldk/structs/ProbabilisticScorer.java | 33 +- .../ProbabilisticScoringDecayParameters.java | 8 +- .../ProbabilisticScoringFeeParameters.java | 130 +- .../org/ldk/structs/ProbeSendFailure.java | 62 +- .../java/org/ldk/structs/ReceiveTlvs.java | 84 +- .../org/ldk/structs/RecentPaymentDetails.java | 25 +- src/main/java/org/ldk/structs/Refund.java | 8 +- ...RefundMaybeWithDerivedMetadataBuilder.java | 20 +- .../java/org/ldk/structs/ReleaseHeldHtlc.java | 25 +- .../org/ldk/structs/ResponseInstruction.java | 14 + ...sult_AsyncPaymentsContextDecodeErrorZ.java | 98 + ...e_DNSSECQueryDNSResolverContextZNoneZ.java | 92 + ...tesThirtyTwoBytesZPaymentSendFailureZ.java | 98 - ...BytesThirtyTwoBytesZProbeSendFailureZ.java | 98 + ...sult_CVec_C3Tuple_StrStrStrZZIOErrorZ.java | 101 + ...Result_DNSResolverContextDecodeErrorZ.java | 98 + ...Result_DNSResolverMessageDecodeErrorZ.java | 98 + .../Result_HumanReadableNameDecodeErrorZ.java | 98 + .../Result_HumanReadableNameNoneZ.java | 92 + .../Result_InvoiceRequestDecodeErrorZ.java | 98 + ...vedPayerIdBuilderBolt12SemanticErrorZ.java | 86 - ...ningPubkeyBuilderBolt12SemanticErrorZ.java | 86 + ...citPayerIdBuilderBolt12SemanticErrorZ.java | 86 - .../structs/Result_MonitorNameIOErrorZ.java | 86 + .../Result_NoneBolt12PaymentErrorZ.java | 92 + .../Result_NonePaymentSendFailureZ.java | 92 - .../Result_SiPrefixBolt11ParseErrorZ.java | 2 +- ...gnedRawBolt11InvoiceBolt11ParseErrorZ.java | 2 +- ...ult_ThirtyTwoBytesPaymentSendFailureZ.java | 95 - ...ult_UnknownPaymentContextDecodeErrorZ.java | 98 - ...nedInvoiceRequestBolt12SemanticErrorZ.java | 95 - .../structs/Result_UpdateNameIOErrorZ.java | 86 + src/main/java/org/ldk/structs/Router.java | 19 +- .../ldk/structs/RoutingMessageHandler.java | 57 +- .../ldk/structs/ThreeTuple_StrStrStrZ.java | 83 + ...manReadableNameThirtyTwoBytesZZOfferZ.java | 84 + ...HumanReadableNameThirtyTwoBytesZZStrZ.java | 81 + ...solverMessageMessageSendInstructionsZ.java | 79 + ...NSResolverMessageResponseInstructionZ.java | 79 + ...oTuple_DNSSECQueryDNSResolverContextZ.java | 79 + ...uple_HumanReadableNameThirtyTwoBytesZ.java | 76 + .../structs/TwoTuple_PublicKeyChannelIdZ.java | 76 + ...woTuple_ThirtyTwoBytesChannelManagerZ.java | 6 +- .../org/ldk/structs/TwoTuple_boolboolZ.java | 73 + src/main/java/org/ldk/structs/TxAbort.java | 4 +- src/main/java/org/ldk/structs/TxAckRbf.java | 4 +- src/main/java/org/ldk/structs/TxAddInput.java | 4 +- .../java/org/ldk/structs/TxAddOutput.java | 4 +- src/main/java/org/ldk/structs/TxComplete.java | 4 +- src/main/java/org/ldk/structs/TxInitRbf.java | 4 +- .../java/org/ldk/structs/TxRemoveInput.java | 4 +- .../java/org/ldk/structs/TxRemoveOutput.java | 4 +- .../java/org/ldk/structs/TxSignatures.java | 4 +- .../structs/UnauthenticatedReceiveTlvs.java | 154 + .../ldk/structs/UnknownPaymentContext.java | 78 - .../ldk/structs/UnsignedBolt12Invoice.java | 59 +- .../ldk/structs/UnsignedInvoiceRequest.java | 53 +- src/main/java/org/ldk/structs/UpdateName.java | 100 + src/main/java/org/ldk/structs/UserConfig.java | 41 +- .../java/org/ldk/structs/UtilMethods.java | 142 +- .../java/org/ldk/structs/Verification.java | 103 + .../ldk/structs/VerifiedInvoiceRequest.java | 59 +- src/main/jni/bindings.c | 10941 ++++++++++------ src/main/jni/bindings.c.body | 10941 ++++++++++------ src/main/jni/org_ldk_impl_bindings.h | 5522 +++++--- ...dk_impl_bindings_LDKAsyncPaymentsContext.h | 21 + ...mpl_bindings_LDKBolt11InvoiceDescription.h | 21 + ...rg_ldk_impl_bindings_LDKBolt11ParseError.h | 21 - ...HumanReadableNameThirtyTwoBytesZZOfferZZ.h | 21 + ...e_HumanReadableNameThirtyTwoBytesZZStrZZ.h | 21 + ..._DNSResolverMessageResponseInstructionZZ.h | 21 + ..._LDKCOption_C2Tuple_PublicKeyChannelIdZZ.h | 21 + ..._ldk_impl_bindings_LDKDNSResolverMessage.h | 21 + ...ldk_impl_bindings_LDKInboundChannelFunds.h | 21 + ..._ldk_impl_bindings_LDKPaymentSendFailure.h | 21 - 149 files changed, 25358 insertions(+), 12991 deletions(-) create mode 100644 src/main/java/org/ldk/structs/AsyncPaymentsContext.java create mode 100644 src/main/java/org/ldk/structs/Bolt11InvoiceDescription.java create mode 100644 src/main/java/org/ldk/structs/Bolt11InvoiceParameters.java create mode 100644 src/main/java/org/ldk/structs/DNSResolverContext.java create mode 100644 src/main/java/org/ldk/structs/DNSResolverMessage.java create mode 100644 src/main/java/org/ldk/structs/DNSResolverMessageHandler.java create mode 100644 src/main/java/org/ldk/structs/DNSSECProof.java create mode 100644 src/main/java/org/ldk/structs/DNSSECQuery.java create mode 100644 src/main/java/org/ldk/structs/HumanReadableName.java create mode 100644 src/main/java/org/ldk/structs/InboundChannelFunds.java rename src/main/java/org/ldk/structs/{InvoiceRequestWithDerivedPayerIdBuilder.java => InvoiceRequestWithDerivedPayerSigningPubkeyBuilder.java} (77%) delete mode 100644 src/main/java/org/ldk/structs/InvoiceRequestWithExplicitPayerIdBuilder.java create mode 100644 src/main/java/org/ldk/structs/MigratableKVStore.java create mode 100644 src/main/java/org/ldk/structs/MonitorName.java create mode 100644 src/main/java/org/ldk/structs/OMNameResolver.java create mode 100644 src/main/java/org/ldk/structs/Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.java create mode 100644 src/main/java/org/ldk/structs/Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.java create mode 100644 src/main/java/org/ldk/structs/Option_C2Tuple_DNSResolverMessageResponseInstructionZZ.java create mode 100644 src/main/java/org/ldk/structs/Option_C2Tuple_PublicKeyChannelIdZZ.java delete mode 100644 src/main/java/org/ldk/structs/PaymentSendFailure.java create mode 100644 src/main/java/org/ldk/structs/Result_AsyncPaymentsContextDecodeErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ.java delete mode 100644 src/main/java/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.java create mode 100644 src/main/java/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ.java create mode 100644 src/main/java/org/ldk/structs/Result_CVec_C3Tuple_StrStrStrZZIOErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_DNSResolverContextDecodeErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_DNSResolverMessageDecodeErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_HumanReadableNameDecodeErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_HumanReadableNameNoneZ.java create mode 100644 src/main/java/org/ldk/structs/Result_InvoiceRequestDecodeErrorZ.java delete mode 100644 src/main/java/org/ldk/structs/Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ.java delete mode 100644 src/main/java/org/ldk/structs/Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_MonitorNameIOErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_NoneBolt12PaymentErrorZ.java delete mode 100644 src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java delete mode 100644 src/main/java/org/ldk/structs/Result_ThirtyTwoBytesPaymentSendFailureZ.java delete mode 100644 src/main/java/org/ldk/structs/Result_UnknownPaymentContextDecodeErrorZ.java delete mode 100644 src/main/java/org/ldk/structs/Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_UpdateNameIOErrorZ.java create mode 100644 src/main/java/org/ldk/structs/ThreeTuple_StrStrStrZ.java create mode 100644 src/main/java/org/ldk/structs/TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ.java create mode 100644 src/main/java/org/ldk/structs/TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ.java create mode 100644 src/main/java/org/ldk/structs/TwoTuple_DNSResolverMessageMessageSendInstructionsZ.java create mode 100644 src/main/java/org/ldk/structs/TwoTuple_DNSResolverMessageResponseInstructionZ.java create mode 100644 src/main/java/org/ldk/structs/TwoTuple_DNSSECQueryDNSResolverContextZ.java create mode 100644 src/main/java/org/ldk/structs/TwoTuple_HumanReadableNameThirtyTwoBytesZ.java create mode 100644 src/main/java/org/ldk/structs/TwoTuple_PublicKeyChannelIdZ.java create mode 100644 src/main/java/org/ldk/structs/TwoTuple_boolboolZ.java create mode 100644 src/main/java/org/ldk/structs/UnauthenticatedReceiveTlvs.java delete mode 100644 src/main/java/org/ldk/structs/UnknownPaymentContext.java create mode 100644 src/main/java/org/ldk/structs/UpdateName.java create mode 100644 src/main/java/org/ldk/structs/Verification.java create mode 100644 src/main/jni/org_ldk_impl_bindings_LDKAsyncPaymentsContext.h create mode 100644 src/main/jni/org_ldk_impl_bindings_LDKBolt11InvoiceDescription.h delete mode 100644 src/main/jni/org_ldk_impl_bindings_LDKBolt11ParseError.h create mode 100644 src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.h create mode 100644 src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.h create mode 100644 src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ.h create mode 100644 src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_PublicKeyChannelIdZZ.h create mode 100644 src/main/jni/org_ldk_impl_bindings_LDKDNSResolverMessage.h create mode 100644 src/main/jni/org_ldk_impl_bindings_LDKInboundChannelFunds.h delete mode 100644 src/main/jni/org_ldk_impl_bindings_LDKPaymentSendFailure.h diff --git a/src/main/java/org/ldk/enums/Bolt12SemanticError.java b/src/main/java/org/ldk/enums/Bolt12SemanticError.java index 998a7232..b7fcba78 100644 --- a/src/main/java/org/ldk/enums/Bolt12SemanticError.java +++ b/src/main/java/org/ldk/enums/Bolt12SemanticError.java @@ -5,7 +5,7 @@ package org.ldk.enums; */ public enum Bolt12SemanticError { /** - * The current [`std::time::SystemTime`] is past the offer or invoice's expiration. + * The current system time is past the offer or invoice's expiration. */ LDKBolt12SemanticError_AlreadyExpired, /** @@ -21,7 +21,7 @@ public enum Bolt12SemanticError { */ LDKBolt12SemanticError_MissingAmount, /** - * The amount exceeded the total bitcoin supply. + * The amount exceeded the total bitcoin supply or didn't match an expected amount. */ LDKBolt12SemanticError_InvalidAmount, /** @@ -49,17 +49,13 @@ public enum Bolt12SemanticError { */ LDKBolt12SemanticError_MissingDescription, /** - * A signing pubkey was not provided. - */ - LDKBolt12SemanticError_MissingSigningPubkey, - /** - * A signing pubkey was provided but a different one was expected. + * An issuer's signing pubkey was not provided. */ - LDKBolt12SemanticError_InvalidSigningPubkey, + LDKBolt12SemanticError_MissingIssuerSigningPubkey, /** - * A signing pubkey was provided but was not expected. + * An issuer's signing pubkey was provided but was not expected. */ - LDKBolt12SemanticError_UnexpectedSigningPubkey, + LDKBolt12SemanticError_UnexpectedIssuerSigningPubkey, /** * A quantity was expected but was missing. */ @@ -85,9 +81,9 @@ public enum Bolt12SemanticError { */ LDKBolt12SemanticError_MissingPayerMetadata, /** - * A payer id was expected but was missing. + * A payer signing pubkey was expected but was missing. */ - LDKBolt12SemanticError_MissingPayerId, + LDKBolt12SemanticError_MissingPayerSigningPubkey, /** * The payment id for a refund or request is already in use. */ @@ -116,10 +112,25 @@ public enum Bolt12SemanticError { * An invoice payment hash was provided but was not expected. */ LDKBolt12SemanticError_UnexpectedPaymentHash, + /** + * A signing pubkey was not provided. + */ + LDKBolt12SemanticError_MissingSigningPubkey, + /** + * A signing pubkey was provided but a different one was expected. + */ + LDKBolt12SemanticError_InvalidSigningPubkey, /** * A signature was expected but was missing. */ LDKBolt12SemanticError_MissingSignature, + /** + * A Human Readable Name was provided but was not expected (i.e. was included in a + * [`Refund`]). + * + * [`Refund`]: super::refund::Refund + */ + LDKBolt12SemanticError_UnexpectedHumanReadableName, ; 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 12e33b9a..3347c8e4 100644 --- a/src/main/java/org/ldk/enums/PaymentFailureReason.java +++ b/src/main/java/org/ldk/enums/PaymentFailureReason.java @@ -22,8 +22,8 @@ public enum PaymentFailureReason { LDKPaymentFailureReason_UserAbandoned, /** * We exhausted all of our retry attempts while trying to send the payment, or we - * exhausted the [`Retry::Timeout`] if the user set one. If at any point a retry - * attempt failed while being forwarded along the path, an [`Event::PaymentPathFailed`] will + * exhausted the [`Retry::Timeout`] if the user set one. + * If at any point a retry attempt failed while being forwarded along the path, an [`Event::PaymentPathFailed`] will * have come before this. * * [`Retry::Timeout`]: crate::ln::channelmanager::Retry::Timeout @@ -40,11 +40,15 @@ public enum PaymentFailureReason { */ LDKPaymentFailureReason_PaymentExpired, /** - * We failed to find a route while retrying the payment. + * We failed to find a route while sending or retrying the payment. * * Note that this generally indicates that we've exhausted the available set of possible * routes - we tried the payment over a few routes but were not able to find any further * candidate routes beyond those. + * + * Also used for [`BlindedPathCreationFailed`] when downgrading to versions prior to 0.0.124. + * + * [`BlindedPathCreationFailed`]: Self::BlindedPathCreationFailed */ LDKPaymentFailureReason_RouteNotFound, /** @@ -66,6 +70,14 @@ public enum PaymentFailureReason { * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest */ LDKPaymentFailureReason_InvoiceRequestRejected, + /** + * Failed to create a blinded path back to ourselves. + * We attempted to initiate payment to a static invoice but failed to create a reply path for our + * [`HeldHtlcAvailable`] message. + * + * [`HeldHtlcAvailable`]: crate::onion_message::async_payments::HeldHtlcAvailable + */ + LDKPaymentFailureReason_BlindedPathCreationFailed, ; 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 3a93bbcf..5a115826 100644 --- a/src/main/java/org/ldk/enums/RetryableSendFailure.java +++ b/src/main/java/org/ldk/enums/RetryableSendFailure.java @@ -10,8 +10,9 @@ package org.ldk.enums; */ public enum RetryableSendFailure { /** - * The provided [`PaymentParameters::expiry_time`] indicated that the payment has expired. Note - * that this error is *not* caused by [`Retry::Timeout`]. + * The provided [`PaymentParameters::expiry_time`] indicated that the payment has expired. + * + * Note that this error is *not* caused by [`Retry::Timeout`]. * * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time */ diff --git a/src/main/java/org/ldk/impl/bindings.java b/src/main/java/org/ldk/impl/bindings.java index 221f9817..43060154 100644 --- a/src/main/java/org/ldk/impl/bindings.java +++ b/src/main/java/org/ldk/impl/bindings.java @@ -182,40 +182,6 @@ public class bindings { public static native long CResult_RetryDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_RetryDecodeErrorZ_get_err(LDKCResult_RetryDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_RetryDecodeErrorZ_get_err(long owner); - public static class LDKAPIError { - private LDKAPIError() {} - public final static class APIMisuseError extends LDKAPIError { - public java.lang.String err; - APIMisuseError(java.lang.String err) { this.err = err; } - } - public final static class FeeRateTooHigh extends LDKAPIError { - public java.lang.String err; - public int feerate; - FeeRateTooHigh(java.lang.String err, int feerate) { this.err = err; this.feerate = feerate; } - } - public final static class InvalidRoute extends LDKAPIError { - public java.lang.String err; - InvalidRoute(java.lang.String err) { this.err = err; } - } - public final static class ChannelUnavailable extends LDKAPIError { - public java.lang.String err; - ChannelUnavailable(java.lang.String err) { this.err = err; } - } - public final static class MonitorUpdateInProgress extends LDKAPIError { - MonitorUpdateInProgress() { } - } - public final static class IncompatibleShutdownScript extends LDKAPIError { - public long script; - IncompatibleShutdownScript(long script) { this.script = script; } - } - static native void init(); - } - static { LDKAPIError.init(); } - public static native LDKAPIError LDKAPIError_ref_from_ptr(long ptr); - // void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner); - public static native void CResult_NoneAPIErrorZ_get_ok(long owner); - // struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner); - public static native long CResult_NoneAPIErrorZ_get_err(long owner); public static class LDKCOption_ThirtyTwoBytesZ { private LDKCOption_ThirtyTwoBytesZ() {} public final static class Some extends LDKCOption_ThirtyTwoBytesZ { @@ -254,6 +220,193 @@ public class bindings { public static native long CResult_RecipientOnionFieldsNoneZ_get_ok(long owner); // void CResult_RecipientOnionFieldsNoneZ_get_err(LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR owner); public static native void CResult_RecipientOnionFieldsNoneZ_get_err(long owner); + public static class LDKDNSResolverMessage { + private LDKDNSResolverMessage() {} + public final static class DNSSECQuery extends LDKDNSResolverMessage { + public long dnssec_query; + DNSSECQuery(long dnssec_query) { this.dnssec_query = dnssec_query; } + } + public final static class DNSSECProof extends LDKDNSResolverMessage { + public long dnssec_proof; + DNSSECProof(long dnssec_proof) { this.dnssec_proof = dnssec_proof; } + } + static native void init(); + } + static { LDKDNSResolverMessage.init(); } + public static native LDKDNSResolverMessage LDKDNSResolverMessage_ref_from_ptr(long ptr); + // struct LDKDNSResolverMessage C2Tuple_DNSResolverMessageResponseInstructionZ_get_a(LDKC2Tuple_DNSResolverMessageResponseInstructionZ *NONNULL_PTR owner); + public static native long C2Tuple_DNSResolverMessageResponseInstructionZ_get_a(long owner); + // struct LDKResponseInstruction C2Tuple_DNSResolverMessageResponseInstructionZ_get_b(LDKC2Tuple_DNSResolverMessageResponseInstructionZ *NONNULL_PTR owner); + public static native long C2Tuple_DNSResolverMessageResponseInstructionZ_get_b(long owner); + public static class LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ { + private LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ() {} + public final static class Some extends LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ { + public long some; + Some(long some) { this.some = some; } + } + public final static class None extends LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ { + None() { } + } + static native void init(); + } + static { LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ.init(); } + public static native LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_ref_from_ptr(long ptr); + public static class LDKDestination { + private LDKDestination() {} + public final static class Node extends LDKDestination { + public byte[] node; + Node(byte[] node) { this.node = node; } + } + public final static class BlindedPath extends LDKDestination { + public long blinded_path; + BlindedPath(long blinded_path) { this.blinded_path = blinded_path; } + } + static native void init(); + } + static { LDKDestination.init(); } + public static native LDKDestination LDKDestination_ref_from_ptr(long ptr); + 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; + public long nonce; + public byte[] hmac; + InboundPayment(byte[] payment_hash, long nonce, byte[] hmac) { this.payment_hash = payment_hash; this.nonce = nonce; this.hmac = hmac; } + } + static native void init(); + } + static { LDKOffersContext.init(); } + public static native LDKOffersContext LDKOffersContext_ref_from_ptr(long ptr); + public static class LDKAsyncPaymentsContext { + private LDKAsyncPaymentsContext() {} + public final static class OutboundPayment extends LDKAsyncPaymentsContext { + 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; } + } + static native void init(); + } + static { LDKAsyncPaymentsContext.init(); } + public static native LDKAsyncPaymentsContext LDKAsyncPaymentsContext_ref_from_ptr(long ptr); + 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 AsyncPayments extends LDKMessageContext { + public long async_payments; + AsyncPayments(long async_payments) { this.async_payments = async_payments; } + } + public final static class DNSResolver extends LDKMessageContext { + public long dns_resolver; + DNSResolver(long dns_resolver) { this.dns_resolver = dns_resolver; } + } + 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 LDKDNSResolverMessage C2Tuple_DNSResolverMessageMessageSendInstructionsZ_get_a(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ *NONNULL_PTR owner); + public static native long C2Tuple_DNSResolverMessageMessageSendInstructionsZ_get_a(long owner); + // struct LDKMessageSendInstructions C2Tuple_DNSResolverMessageMessageSendInstructionsZ_get_b(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ *NONNULL_PTR owner); + public static native long C2Tuple_DNSResolverMessageMessageSendInstructionsZ_get_b(long owner); + // struct LDKDNSResolverMessage CResult_DNSResolverMessageDecodeErrorZ_get_ok(LDKCResult_DNSResolverMessageDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_DNSResolverMessageDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_DNSResolverMessageDecodeErrorZ_get_err(LDKCResult_DNSResolverMessageDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_DNSResolverMessageDecodeErrorZ_get_err(long owner); + // struct LDKHumanReadableName CResult_HumanReadableNameNoneZ_get_ok(LDKCResult_HumanReadableNameNoneZ *NONNULL_PTR owner); + public static native long CResult_HumanReadableNameNoneZ_get_ok(long owner); + // void CResult_HumanReadableNameNoneZ_get_err(LDKCResult_HumanReadableNameNoneZ *NONNULL_PTR owner); + public static native void CResult_HumanReadableNameNoneZ_get_err(long owner); + // struct LDKHumanReadableName CResult_HumanReadableNameDecodeErrorZ_get_ok(LDKCResult_HumanReadableNameDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_HumanReadableNameDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_HumanReadableNameDecodeErrorZ_get_err(LDKCResult_HumanReadableNameDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_HumanReadableNameDecodeErrorZ_get_err(long owner); + // struct LDKDNSSECQuery C2Tuple_DNSSECQueryDNSResolverContextZ_get_a(LDKC2Tuple_DNSSECQueryDNSResolverContextZ *NONNULL_PTR owner); + public static native long C2Tuple_DNSSECQueryDNSResolverContextZ_get_a(long owner); + // struct LDKDNSResolverContext C2Tuple_DNSSECQueryDNSResolverContextZ_get_b(LDKC2Tuple_DNSSECQueryDNSResolverContextZ *NONNULL_PTR owner); + public static native long C2Tuple_DNSSECQueryDNSResolverContextZ_get_b(long owner); + // struct LDKC2Tuple_DNSSECQueryDNSResolverContextZ CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_get_ok(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ *NONNULL_PTR owner); + public static native long CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_get_ok(long owner); + // void CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_get_err(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ *NONNULL_PTR owner); + public static native void CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_get_err(long owner); + // struct LDKHumanReadableName C2Tuple_HumanReadableNameThirtyTwoBytesZ_get_a(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ *NONNULL_PTR owner); + public static native long C2Tuple_HumanReadableNameThirtyTwoBytesZ_get_a(long owner); + // struct LDKThirtyTwoBytes C2Tuple_HumanReadableNameThirtyTwoBytesZ_get_b(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ *NONNULL_PTR owner); + public static native byte[] C2Tuple_HumanReadableNameThirtyTwoBytesZ_get_b(long owner); + // struct LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_get_a(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ *NONNULL_PTR owner); + public static native long[] C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_get_a(long owner); + // struct LDKOffer C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_get_b(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ *NONNULL_PTR owner); + public static native long C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_get_b(long owner); + public static class LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ { + private LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ() {} + public final static class Some extends LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ { + public long some; + Some(long some) { this.some = some; } + } + public final static class None extends LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ { + None() { } + } + static native void init(); + } + static { LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.init(); } + public static native LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_ref_from_ptr(long ptr); + // struct LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_get_a(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ *NONNULL_PTR owner); + public static native long[] C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_get_a(long owner); + // struct LDKStr C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_get_b(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ *NONNULL_PTR owner); + public static native String C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_get_b(long owner); + public static class LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ { + private LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ() {} + public final static class Some extends LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ { + public long some; + Some(long some) { this.some = some; } + } + public final static class None extends LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ { + None() { } + } + static native void init(); + } + static { LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.init(); } + public static native LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_ref_from_ptr(long ptr); // struct LDKUnsignedBolt12Invoice CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner); public static native long CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok(long owner); // enum LDKBolt12SemanticError CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner); @@ -483,6 +636,7 @@ public class bindings { long sign_closing_transaction(long closing_tx); long sign_holder_anchor_input(byte[] anchor_tx, long input); long sign_channel_announcement_with_funding_key(long msg); + long sign_splicing_funding_input(byte[] tx, long input_index, long input_value); } public static native long LDKEcdsaChannelSigner_new(LDKEcdsaChannelSigner impl, LDKChannelSigner ChannelSigner, long pubkeys); public static native long LDKEcdsaChannelSigner_get_ChannelSigner(long arg); @@ -504,6 +658,8 @@ 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); + // LDKCResult_ECDSASignatureNoneZ EcdsaChannelSigner_sign_splicing_funding_input LDKEcdsaChannelSigner *NONNULL_PTR this_arg, struct LDKTransaction tx, uintptr_t input_index, uint64_t input_value + public static native long EcdsaChannelSigner_sign_splicing_funding_input(long this_arg, byte[] tx, long input_index, long input_value); // 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); @@ -651,14 +807,6 @@ public class bindings { 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_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); @@ -859,34 +1007,6 @@ public class bindings { public static native long[] C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_c(long owner); // struct LDKPublicKey C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_d(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner); public static native byte[] C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_d(long owner); - // struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_InitFeaturesDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_InitFeaturesDecodeErrorZ_get_err(long owner); - // struct LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_ChannelFeaturesDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_ChannelFeaturesDecodeErrorZ_get_err(long owner); - // struct LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_NodeFeaturesDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_NodeFeaturesDecodeErrorZ_get_err(long owner); - // struct LDKBolt11InvoiceFeatures CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_err(long owner); - // struct LDKBolt12InvoiceFeatures CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_err(long owner); - // struct LDKBlindedHopFeatures CResult_BlindedHopFeaturesDecodeErrorZ_get_ok(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_BlindedHopFeaturesDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_BlindedHopFeaturesDecodeErrorZ_get_err(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_BlindedHopFeaturesDecodeErrorZ_get_err(long owner); - // struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(long owner); // struct LDKOfferId CResult_OfferIdDecodeErrorZ_get_ok(LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_OfferIdDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_OfferIdDecodeErrorZ_get_err(LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR owner); @@ -899,14 +1019,10 @@ public class bindings { public static native long CResult_OfferBolt12SemanticErrorZ_get_ok(long owner); // enum LDKBolt12SemanticError CResult_OfferBolt12SemanticErrorZ_get_err(LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR owner); public static native Bolt12SemanticError CResult_OfferBolt12SemanticErrorZ_get_err(long owner); - // struct LDKInvoiceRequestWithDerivedPayerIdBuilder CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); - public static native long CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(long owner); - // enum LDKBolt12SemanticError CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); - public static native Bolt12SemanticError CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err(long owner); - // struct LDKInvoiceRequestWithExplicitPayerIdBuilder CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); - 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 LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); + public static native long CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(long owner); + // enum LDKBolt12SemanticError CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); + public static native Bolt12SemanticError CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_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); @@ -1369,10 +1485,6 @@ public class bindings { public static native void CResult_CVec_UtxoZNoneZ_get_err(long owner); public static class LDKPaymentContext { private LDKPaymentContext() {} - public final static class Unknown extends LDKPaymentContext { - public long unknown; - Unknown(long unknown) { this.unknown = unknown; } - } public final static class Bolt12Offer extends LDKPaymentContext { public long bolt12_offer; Bolt12Offer(long bolt12_offer) { this.bolt12_offer = bolt12_offer; } @@ -1415,6 +1527,36 @@ public class bindings { } static { LDKCOption_C2Tuple_u64u16ZZ.init(); } public static native LDKCOption_C2Tuple_u64u16ZZ LDKCOption_C2Tuple_u64u16ZZ_ref_from_ptr(long ptr); + public static class LDKAPIError { + private LDKAPIError() {} + public final static class APIMisuseError extends LDKAPIError { + public java.lang.String err; + APIMisuseError(java.lang.String err) { this.err = err; } + } + public final static class FeeRateTooHigh extends LDKAPIError { + public java.lang.String err; + public int feerate; + FeeRateTooHigh(java.lang.String err, int feerate) { this.err = err; this.feerate = feerate; } + } + public final static class InvalidRoute extends LDKAPIError { + public java.lang.String err; + InvalidRoute(java.lang.String err) { this.err = err; } + } + public final static class ChannelUnavailable extends LDKAPIError { + public java.lang.String err; + ChannelUnavailable(java.lang.String err) { this.err = err; } + } + public final static class MonitorUpdateInProgress extends LDKAPIError { + MonitorUpdateInProgress() { } + } + public final static class IncompatibleShutdownScript extends LDKAPIError { + public long script; + IncompatibleShutdownScript(long script) { this.script = script; } + } + static native void init(); + } + static { LDKAPIError.init(); } + public static native LDKAPIError LDKAPIError_ref_from_ptr(long ptr); // struct LDKChannelId CResult_ChannelIdAPIErrorZ_get_ok(LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR owner); public static native long CResult_ChannelIdAPIErrorZ_get_ok(long owner); // struct LDKAPIError CResult_ChannelIdAPIErrorZ_get_err(LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR owner); @@ -1445,45 +1587,50 @@ public class bindings { } static { LDKRecentPaymentDetails.init(); } public static native LDKRecentPaymentDetails LDKRecentPaymentDetails_ref_from_ptr(long ptr); - public static class LDKPaymentSendFailure { - private LDKPaymentSendFailure() {} - public final static class ParameterError extends LDKPaymentSendFailure { - public long parameter_error; - ParameterError(long parameter_error) { this.parameter_error = parameter_error; } + // void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner); + public static native void CResult_NoneAPIErrorZ_get_ok(long owner); + // struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner); + public static native long CResult_NoneAPIErrorZ_get_err(long owner); + // void CResult_NoneRetryableSendFailureZ_get_ok(LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR owner); + public static native void CResult_NoneRetryableSendFailureZ_get_ok(long owner); + // enum LDKRetryableSendFailure CResult_NoneRetryableSendFailureZ_get_err(LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR owner); + public static native RetryableSendFailure CResult_NoneRetryableSendFailureZ_get_err(long owner); + 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() { } } - public final static class PathParameterError extends LDKPaymentSendFailure { - public long[] path_parameter_error; - PathParameterError(long[] path_parameter_error) { this.path_parameter_error = path_parameter_error; } + static native void init(); + } + static { LDKCOption_OffersContextZ.init(); } + public static native LDKCOption_OffersContextZ LDKCOption_OffersContextZ_ref_from_ptr(long ptr); + public static class LDKBolt12PaymentError { + private LDKBolt12PaymentError() {} + public final static class UnexpectedInvoice extends LDKBolt12PaymentError { + UnexpectedInvoice() { } } - public final static class AllFailedResendSafe extends LDKPaymentSendFailure { - public long[] all_failed_resend_safe; - AllFailedResendSafe(long[] all_failed_resend_safe) { this.all_failed_resend_safe = all_failed_resend_safe; } + public final static class DuplicateInvoice extends LDKBolt12PaymentError { + DuplicateInvoice() { } } - public final static class DuplicatePayment extends LDKPaymentSendFailure { - DuplicatePayment() { } + public final static class UnknownRequiredFeatures extends LDKBolt12PaymentError { + UnknownRequiredFeatures() { } } - public final static class PartialFailure extends LDKPaymentSendFailure { - public long[] results; - public long failed_paths_retry; - public byte[] payment_id; - PartialFailure(long[] results, long failed_paths_retry, byte[] payment_id) { this.results = results; this.failed_paths_retry = failed_paths_retry; this.payment_id = payment_id; } + 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 { LDKPaymentSendFailure.init(); } - public static native LDKPaymentSendFailure LDKPaymentSendFailure_ref_from_ptr(long ptr); - // void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner); - public static native void CResult_NonePaymentSendFailureZ_get_ok(long owner); - // struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner); - public static native long CResult_NonePaymentSendFailureZ_get_err(long owner); - // void CResult_NoneRetryableSendFailureZ_get_ok(LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR owner); - public static native void CResult_NoneRetryableSendFailureZ_get_ok(long owner); - // enum LDKRetryableSendFailure CResult_NoneRetryableSendFailureZ_get_err(LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR owner); - public static native RetryableSendFailure CResult_NoneRetryableSendFailureZ_get_err(long owner); - // struct LDKThirtyTwoBytes CResult_ThirtyTwoBytesPaymentSendFailureZ_get_ok(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR owner); - public static native byte[] CResult_ThirtyTwoBytesPaymentSendFailureZ_get_ok(long owner); - // struct LDKPaymentSendFailure CResult_ThirtyTwoBytesPaymentSendFailureZ_get_err(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR owner); - public static native long CResult_ThirtyTwoBytesPaymentSendFailureZ_get_err(long owner); + static { LDKBolt12PaymentError.init(); } + public static native LDKBolt12PaymentError LDKBolt12PaymentError_ref_from_ptr(long ptr); + // void CResult_NoneBolt12PaymentErrorZ_get_ok(LDKCResult_NoneBolt12PaymentErrorZ *NONNULL_PTR owner); + public static native void CResult_NoneBolt12PaymentErrorZ_get_ok(long owner); + // struct LDKBolt12PaymentError CResult_NoneBolt12PaymentErrorZ_get_err(LDKCResult_NoneBolt12PaymentErrorZ *NONNULL_PTR owner); + public static native long CResult_NoneBolt12PaymentErrorZ_get_err(long owner); // struct LDKThirtyTwoBytes CResult_ThirtyTwoBytesRetryableSendFailureZ_get_ok(LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR owner); public static native byte[] CResult_ThirtyTwoBytesRetryableSendFailureZ_get_ok(long owner); // enum LDKRetryableSendFailure CResult_ThirtyTwoBytesRetryableSendFailureZ_get_err(LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR owner); @@ -1492,23 +1639,26 @@ public class bindings { public static native byte[] C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_get_a(long owner); // struct LDKThirtyTwoBytes C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_get_b(LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *NONNULL_PTR owner); public static native byte[] C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_get_b(long owner); - // struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_get_ok(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR owner); - public static native long CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_get_ok(long owner); - // struct LDKPaymentSendFailure CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_get_err(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR owner); - public static native long CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_get_err(long owner); public static class LDKProbeSendFailure { private LDKProbeSendFailure() {} public final static class RouteNotFound extends LDKProbeSendFailure { RouteNotFound() { } } - public final static class SendingFailed extends LDKProbeSendFailure { - public long sending_failed; - SendingFailed(long sending_failed) { this.sending_failed = sending_failed; } + public final static class ParameterError extends LDKProbeSendFailure { + public long parameter_error; + ParameterError(long parameter_error) { this.parameter_error = parameter_error; } + } + public final static class DuplicateProbe extends LDKProbeSendFailure { + DuplicateProbe() { } } static native void init(); } static { LDKProbeSendFailure.init(); } public static native LDKProbeSendFailure LDKProbeSendFailure_ref_from_ptr(long ptr); + // struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_get_ok(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ *NONNULL_PTR owner); + public static native long CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_get_ok(long owner); + // struct LDKProbeSendFailure CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_get_err(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ *NONNULL_PTR owner); + public static native long CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_get_err(long owner); // struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_get_ok(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR owner); public static native long[] CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_get_ok(long owner); // struct LDKProbeSendFailure CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_get_err(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR owner); @@ -1517,6 +1667,40 @@ public class bindings { public static native long C2Tuple_ChannelIdPublicKeyZ_get_a(long owner); // struct LDKPublicKey C2Tuple_ChannelIdPublicKeyZ_get_b(LDKC2Tuple_ChannelIdPublicKeyZ *NONNULL_PTR owner); public static native byte[] C2Tuple_ChannelIdPublicKeyZ_get_b(long owner); + // struct LDKPublicKey C2Tuple_PublicKeyChannelIdZ_get_a(LDKC2Tuple_PublicKeyChannelIdZ *NONNULL_PTR owner); + public static native byte[] C2Tuple_PublicKeyChannelIdZ_get_a(long owner); + // struct LDKChannelId C2Tuple_PublicKeyChannelIdZ_get_b(LDKC2Tuple_PublicKeyChannelIdZ *NONNULL_PTR owner); + public static native long C2Tuple_PublicKeyChannelIdZ_get_b(long owner); + public static class LDKCOption_C2Tuple_PublicKeyChannelIdZZ { + private LDKCOption_C2Tuple_PublicKeyChannelIdZZ() {} + public final static class Some extends LDKCOption_C2Tuple_PublicKeyChannelIdZZ { + public long some; + Some(long some) { this.some = some; } + } + public final static class None extends LDKCOption_C2Tuple_PublicKeyChannelIdZZ { + None() { } + } + static native void init(); + } + static { LDKCOption_C2Tuple_PublicKeyChannelIdZZ.init(); } + public static native LDKCOption_C2Tuple_PublicKeyChannelIdZZ LDKCOption_C2Tuple_PublicKeyChannelIdZZ_ref_from_ptr(long ptr); + 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 LDKOfferWithDerivedMetadataBuilder CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); public static native long CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(long owner); // enum LDKBolt12SemanticError CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); @@ -1542,39 +1726,6 @@ 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 { @@ -1610,58 +1761,6 @@ public class bindings { } 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 { - public byte[] node; - Node(byte[] node) { this.node = node; } - } - public final static class BlindedPath extends LDKDestination { - public long blinded_path; - BlindedPath(long blinded_path) { this.blinded_path = blinded_path; } - } - static native void init(); - } - static { LDKDestination.init(); } - public static native LDKDestination LDKDestination_ref_from_ptr(long ptr); - 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); @@ -1734,7 +1833,8 @@ public class bindings { public int incoming_cltv_expiry; public long[] custom_tlvs; public boolean requires_blinded_error; - ReceiveKeysend(long payment_data, byte[] payment_preimage, long payment_metadata, int incoming_cltv_expiry, long[] custom_tlvs, boolean requires_blinded_error) { this.payment_data = payment_data; this.payment_preimage = payment_preimage; this.payment_metadata = payment_metadata; this.incoming_cltv_expiry = incoming_cltv_expiry; this.custom_tlvs = custom_tlvs; this.requires_blinded_error = requires_blinded_error; } + public boolean has_recipient_created_payment_secret; + ReceiveKeysend(long payment_data, byte[] payment_preimage, long payment_metadata, int incoming_cltv_expiry, long[] custom_tlvs, boolean requires_blinded_error, boolean has_recipient_created_payment_secret) { this.payment_data = payment_data; this.payment_preimage = payment_preimage; this.payment_metadata = payment_metadata; this.incoming_cltv_expiry = incoming_cltv_expiry; this.custom_tlvs = custom_tlvs; this.requires_blinded_error = requires_blinded_error; this.has_recipient_created_payment_secret = has_recipient_created_payment_secret; } } static native void init(); } @@ -1795,25 +1895,22 @@ public class bindings { static { LDKUnsignedGossipMessage.init(); } public static native LDKUnsignedGossipMessage LDKUnsignedGossipMessage_ref_from_ptr(long ptr); public interface LDKNodeSigner { - byte[] get_inbound_payment_key_material(); + long get_inbound_payment_key(); long get_node_id(Recipient recipient); long ecdh(Recipient recipient, byte[] other_key, long tweak); 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); } public static native long LDKNodeSigner_new(LDKNodeSigner impl); - // LDKThirtyTwoBytes NodeSigner_get_inbound_payment_key_material LDKNodeSigner *NONNULL_PTR this_arg - public static native byte[] NodeSigner_get_inbound_payment_key_material(long this_arg); + // LDKExpandedKey NodeSigner_get_inbound_payment_key LDKNodeSigner *NONNULL_PTR this_arg + public static native long NodeSigner_get_inbound_payment_key(long this_arg); // LDKCResult_PublicKeyNoneZ NodeSigner_get_node_id LDKNodeSigner *NONNULL_PTR this_arg, enum LDKRecipient recipient 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, 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 public static native long NodeSigner_sign_bolt12_invoice(long this_arg, long invoice); // LDKCResult_ECDSASignatureNoneZ NodeSigner_sign_gossip_message LDKNodeSigner *NONNULL_PTR this_arg, struct LDKUnsignedGossipMessage msg @@ -1842,31 +1939,38 @@ public class bindings { public static native long LDKFeeEstimator_new(LDKFeeEstimator impl); // uint32_t FeeEstimator_get_est_sat_per_1000_weight LDKFeeEstimator *NONNULL_PTR this_arg, enum LDKConfirmationTarget confirmation_target 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, 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_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); long create_blinded_payment_paths(byte[] recipient, long[] first_hops, long tlvs, long amount_msats); } - public static native long LDKRouter_new(LDKRouter impl, LDKMessageRouter MessageRouter); - public static native long LDKRouter_get_MessageRouter(long arg); + public static native long LDKRouter_new(LDKRouter impl); // LDKCResult_RouteLightningErrorZ Router_find_route LDKRouter *NONNULL_PTR this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKInFlightHtlcs inflight_htlcs 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_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 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_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); + public interface LDKMessageRouter { + long find_path(byte[] sender, byte[][] peers, long destination); + 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_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); // struct LDKThirtyTwoBytes C2Tuple_ThirtyTwoBytesChannelManagerZ_get_a(LDKC2Tuple_ThirtyTwoBytesChannelManagerZ *NONNULL_PTR owner); public static native byte[] C2Tuple_ThirtyTwoBytesChannelManagerZ_get_a(long owner); // struct LDKChannelManager C2Tuple_ThirtyTwoBytesChannelManagerZ_get_b(LDKC2Tuple_ThirtyTwoBytesChannelManagerZ *NONNULL_PTR owner); @@ -1976,6 +2080,10 @@ public class bindings { public static native byte[] C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_get_a(long owner); // struct LDKCVec_C2Tuple_u32TxOutZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_get_b(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner); public static native long[] C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_get_b(long owner); + // bool C2Tuple_boolboolZ_get_a(LDKC2Tuple_boolboolZ *NONNULL_PTR owner); + public static native boolean C2Tuple_boolboolZ_get_a(long owner); + // bool C2Tuple_boolboolZ_get_b(LDKC2Tuple_boolboolZ *NONNULL_PTR owner); + public static native boolean C2Tuple_boolboolZ_get_b(long owner); public static class LDKBalance { private LDKBalance() {} public final static class ClaimableOnChannelClose extends LDKBalance { @@ -2166,6 +2274,16 @@ public class bindings { public static native String[] CResult_CVec_StrZIOErrorZ_get_ok(long owner); // enum LDKIOError CResult_CVec_StrZIOErrorZ_get_err(LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR owner); public static native IOError CResult_CVec_StrZIOErrorZ_get_err(long owner); + // struct LDKStr C3Tuple_StrStrStrZ_get_a(LDKC3Tuple_StrStrStrZ *NONNULL_PTR owner); + public static native String C3Tuple_StrStrStrZ_get_a(long owner); + // struct LDKStr C3Tuple_StrStrStrZ_get_b(LDKC3Tuple_StrStrStrZ *NONNULL_PTR owner); + public static native String C3Tuple_StrStrStrZ_get_b(long owner); + // struct LDKStr C3Tuple_StrStrStrZ_get_c(LDKC3Tuple_StrStrStrZ *NONNULL_PTR owner); + public static native String C3Tuple_StrStrStrZ_get_c(long owner); + // struct LDKCVec_C3Tuple_StrStrStrZZ CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_get_ok(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ *NONNULL_PTR owner); + public static native long[] CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_get_ok(long owner); + // enum LDKIOError CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_get_err(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ *NONNULL_PTR owner); + public static native IOError CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_get_err(long owner); // struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_get_ok(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR owner); public static native long[] CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_get_ok(long owner); // enum LDKIOError CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_get_err(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR owner); @@ -2174,10 +2292,14 @@ public class bindings { public static native long CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_get_ok(long owner); // enum LDKIOError CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_get_err(LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR owner); public static native IOError CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_get_err(long owner); - // struct LDKUnsignedInvoiceRequest CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner); - public static native long CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(long owner); - // enum LDKBolt12SemanticError CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner); - public static native Bolt12SemanticError CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err(long owner); + // struct LDKMonitorName CResult_MonitorNameIOErrorZ_get_ok(LDKCResult_MonitorNameIOErrorZ *NONNULL_PTR owner); + public static native long CResult_MonitorNameIOErrorZ_get_ok(long owner); + // enum LDKIOError CResult_MonitorNameIOErrorZ_get_err(LDKCResult_MonitorNameIOErrorZ *NONNULL_PTR owner); + public static native IOError CResult_MonitorNameIOErrorZ_get_err(long owner); + // struct LDKUpdateName CResult_UpdateNameIOErrorZ_get_ok(LDKCResult_UpdateNameIOErrorZ *NONNULL_PTR owner); + public static native long CResult_UpdateNameIOErrorZ_get_ok(long owner); + // enum LDKIOError CResult_UpdateNameIOErrorZ_get_err(LDKCResult_UpdateNameIOErrorZ *NONNULL_PTR owner); + public static native IOError CResult_UpdateNameIOErrorZ_get_err(long owner); // struct LDKInvoiceRequest CResult_InvoiceRequestBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner); public static native long CResult_InvoiceRequestBolt12SemanticErrorZ_get_ok(long owner); // enum LDKBolt12SemanticError CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner); @@ -2194,6 +2316,10 @@ public class bindings { public static native long CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(long owner); // enum LDKBolt12SemanticError CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); public static native Bolt12SemanticError CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(long owner); + // struct LDKInvoiceRequest CResult_InvoiceRequestDecodeErrorZ_get_ok(LDKCResult_InvoiceRequestDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_InvoiceRequestDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_InvoiceRequestDecodeErrorZ_get_err(LDKCResult_InvoiceRequestDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_InvoiceRequestDecodeErrorZ_get_err(long owner); // struct LDKInvoiceRequestFields CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok(LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_InvoiceRequestFieldsDecodeErrorZ_get_err(LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR owner); @@ -2783,6 +2909,19 @@ public class bindings { } static { LDKCOption_U128Z.init(); } public static native LDKCOption_U128Z LDKCOption_U128Z_ref_from_ptr(long ptr); + public static class LDKInboundChannelFunds { + private LDKInboundChannelFunds() {} + public final static class PushMsat extends LDKInboundChannelFunds { + public long push_msat; + PushMsat(long push_msat) { this.push_msat = push_msat; } + } + public final static class DualFunded extends LDKInboundChannelFunds { + DualFunded() { } + } + static native void init(); + } + static { LDKInboundChannelFunds.init(); } + public static native LDKInboundChannelFunds LDKInboundChannelFunds_ref_from_ptr(long ptr); public static class LDKBumpTransactionEvent { private LDKBumpTransactionEvent() {} public final static class ChannelClose extends LDKBumpTransactionEvent { @@ -2837,7 +2976,8 @@ public class bindings { public long via_channel_id; public long via_user_channel_id; public long claim_deadline; - PaymentClaimable(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) { this.receiver_node_id = receiver_node_id; this.payment_hash = payment_hash; this.onion_fields = onion_fields; this.amount_msat = amount_msat; this.counterparty_skimmed_fee_msat = counterparty_skimmed_fee_msat; this.purpose = purpose; this.via_channel_id = via_channel_id; this.via_user_channel_id = via_user_channel_id; this.claim_deadline = claim_deadline; } + public long payment_id; + PaymentClaimable(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, long payment_id) { this.receiver_node_id = receiver_node_id; this.payment_hash = payment_hash; this.onion_fields = onion_fields; this.amount_msat = amount_msat; this.counterparty_skimmed_fee_msat = counterparty_skimmed_fee_msat; this.purpose = purpose; this.via_channel_id = via_channel_id; this.via_user_channel_id = via_user_channel_id; this.claim_deadline = claim_deadline; this.payment_id = payment_id; } } public final static class PaymentClaimed extends LDKEvent { public byte[] receiver_node_id; @@ -2847,7 +2987,8 @@ public class bindings { public long[] htlcs; public long 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 long payment_id; + PaymentClaimed(byte[] receiver_node_id, byte[] payment_hash, long amount_msat, long purpose, long[] htlcs, long sender_intended_total_msat, long onion_fields, long payment_id) { 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; this.payment_id = payment_id; } } public final static class ConnectionNeeded extends LDKEvent { public byte[] node_id; @@ -2924,11 +3065,13 @@ public class bindings { public long next_channel_id; public long prev_user_channel_id; public long next_user_channel_id; + public byte[] prev_node_id; + public byte[] next_node_id; public long total_fee_earned_msat; public long skimmed_fee_msat; public boolean claim_from_onchain_tx; public long outbound_amount_forwarded_msat; - PaymentForwarded(long prev_channel_id, long next_channel_id, long prev_user_channel_id, long next_user_channel_id, long total_fee_earned_msat, long skimmed_fee_msat, boolean claim_from_onchain_tx, long outbound_amount_forwarded_msat) { this.prev_channel_id = prev_channel_id; this.next_channel_id = next_channel_id; this.prev_user_channel_id = prev_user_channel_id; this.next_user_channel_id = next_user_channel_id; this.total_fee_earned_msat = total_fee_earned_msat; this.skimmed_fee_msat = skimmed_fee_msat; this.claim_from_onchain_tx = claim_from_onchain_tx; this.outbound_amount_forwarded_msat = outbound_amount_forwarded_msat; } + PaymentForwarded(long prev_channel_id, long next_channel_id, long prev_user_channel_id, long next_user_channel_id, byte[] prev_node_id, byte[] next_node_id, long total_fee_earned_msat, long skimmed_fee_msat, boolean claim_from_onchain_tx, long outbound_amount_forwarded_msat) { this.prev_channel_id = prev_channel_id; this.next_channel_id = next_channel_id; this.prev_user_channel_id = prev_user_channel_id; this.next_user_channel_id = next_user_channel_id; this.prev_node_id = prev_node_id; this.next_node_id = next_node_id; this.total_fee_earned_msat = total_fee_earned_msat; this.skimmed_fee_msat = skimmed_fee_msat; this.claim_from_onchain_tx = claim_from_onchain_tx; this.outbound_amount_forwarded_msat = outbound_amount_forwarded_msat; } } public final static class ChannelPending extends LDKEvent { public long channel_id; @@ -2953,7 +3096,8 @@ public class bindings { public byte[] counterparty_node_id; public long channel_capacity_sats; public long channel_funding_txo; - ChannelClosed(long channel_id, byte[] user_channel_id, long reason, byte[] counterparty_node_id, long channel_capacity_sats, long channel_funding_txo) { this.channel_id = channel_id; this.user_channel_id = user_channel_id; this.reason = reason; this.counterparty_node_id = counterparty_node_id; this.channel_capacity_sats = channel_capacity_sats; this.channel_funding_txo = channel_funding_txo; } + public long last_local_balance_msat; + ChannelClosed(long channel_id, byte[] user_channel_id, long reason, byte[] counterparty_node_id, long channel_capacity_sats, long channel_funding_txo, long last_local_balance_msat) { this.channel_id = channel_id; this.user_channel_id = user_channel_id; this.reason = reason; this.counterparty_node_id = counterparty_node_id; this.channel_capacity_sats = channel_capacity_sats; this.channel_funding_txo = channel_funding_txo; this.last_local_balance_msat = last_local_balance_msat; } } public final static class DiscardFunding extends LDKEvent { public long channel_id; @@ -2964,11 +3108,11 @@ public class bindings { public long temporary_channel_id; public byte[] counterparty_node_id; public long funding_satoshis; - public long push_msat; + public long channel_negotiation_type; public long 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; } + OpenChannelRequest(long temporary_channel_id, byte[] counterparty_node_id, long funding_satoshis, long channel_negotiation_type, 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.channel_negotiation_type = channel_negotiation_type; 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; @@ -3013,71 +3157,6 @@ public class bindings { 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 { - public long bech32_error; - Bech32Error(long bech32_error) { this.bech32_error = bech32_error; } - } - public final static class ParseAmountError extends LDKBolt11ParseError { - public int parse_amount_error; - ParseAmountError(int parse_amount_error) { this.parse_amount_error = parse_amount_error; } - } - public final static class MalformedSignature extends LDKBolt11ParseError { - public org.ldk.enums.Secp256k1Error malformed_signature; - MalformedSignature(org.ldk.enums.Secp256k1Error malformed_signature) { this.malformed_signature = malformed_signature; } - } - public final static class BadPrefix extends LDKBolt11ParseError { - BadPrefix() { } - } - public final static class UnknownCurrency extends LDKBolt11ParseError { - UnknownCurrency() { } - } - public final static class UnknownSiPrefix extends LDKBolt11ParseError { - UnknownSiPrefix() { } - } - public final static class MalformedHRP extends LDKBolt11ParseError { - MalformedHRP() { } - } - public final static class TooShortDataPart extends LDKBolt11ParseError { - TooShortDataPart() { } - } - public final static class UnexpectedEndOfTaggedFields extends LDKBolt11ParseError { - UnexpectedEndOfTaggedFields() { } - } - public final static class DescriptionDecodeError extends LDKBolt11ParseError { - public int description_decode_error; - DescriptionDecodeError(int description_decode_error) { this.description_decode_error = description_decode_error; } - } - public final static class PaddingError extends LDKBolt11ParseError { - PaddingError() { } - } - public final static class IntegerOverflowError extends LDKBolt11ParseError { - IntegerOverflowError() { } - } - public final static class InvalidSegWitProgramLength extends LDKBolt11ParseError { - InvalidSegWitProgramLength() { } - } - public final static class InvalidPubKeyHashLength extends LDKBolt11ParseError { - InvalidPubKeyHashLength() { } - } - public final static class InvalidScriptHashLength extends LDKBolt11ParseError { - InvalidScriptHashLength() { } - } - public final static class InvalidRecoveryId extends LDKBolt11ParseError { - InvalidRecoveryId() { } - } - public final static class InvalidSliceLength extends LDKBolt11ParseError { - public java.lang.String invalid_slice_length; - InvalidSliceLength(java.lang.String invalid_slice_length) { this.invalid_slice_length = invalid_slice_length; } - } - public final static class Skip extends LDKBolt11ParseError { - Skip() { } - } - static native void init(); - } - static { LDKBolt11ParseError.init(); } - public static native LDKBolt11ParseError LDKBolt11ParseError_ref_from_ptr(long ptr); // enum LDKSiPrefix CResult_SiPrefixBolt11ParseErrorZ_get_ok(LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR owner); public static native SiPrefix CResult_SiPrefixBolt11ParseErrorZ_get_ok(long owner); // struct LDKBolt11ParseError CResult_SiPrefixBolt11ParseErrorZ_get_err(LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR owner); @@ -3162,6 +3241,34 @@ public class bindings { public static native long CResult_ChannelIdDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_ChannelIdDecodeErrorZ_get_err(LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_ChannelIdDecodeErrorZ_get_err(long owner); + // struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_InitFeaturesDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_InitFeaturesDecodeErrorZ_get_err(long owner); + // struct LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ChannelFeaturesDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ChannelFeaturesDecodeErrorZ_get_err(long owner); + // struct LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_NodeFeaturesDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_NodeFeaturesDecodeErrorZ_get_err(long owner); + // struct LDKBolt11InvoiceFeatures CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_err(long owner); + // struct LDKBolt12InvoiceFeatures CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_err(long owner); + // struct LDKBlindedHopFeatures CResult_BlindedHopFeaturesDecodeErrorZ_get_ok(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_BlindedHopFeaturesDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_BlindedHopFeaturesDecodeErrorZ_get_err(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_BlindedHopFeaturesDecodeErrorZ_get_err(long owner); + // struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(long owner); // struct LDKThirtyTwoBytes C2Tuple__u832u16Z_get_a(LDKC2Tuple__u832u16Z *NONNULL_PTR owner); public static native byte[] C2Tuple__u832u16Z_get_a(long owner); // uint16_t C2Tuple__u832u16Z_get_b(LDKC2Tuple__u832u16Z *NONNULL_PTR owner); @@ -3186,10 +3293,6 @@ public class bindings { public static native long CResult_PaymentContextDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_PaymentContextDecodeErrorZ_get_err(LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_PaymentContextDecodeErrorZ_get_err(long owner); - // struct LDKUnknownPaymentContext CResult_UnknownPaymentContextDecodeErrorZ_get_ok(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_UnknownPaymentContextDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_UnknownPaymentContextDecodeErrorZ_get_err(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_UnknownPaymentContextDecodeErrorZ_get_err(long owner); // struct LDKBolt12OfferContext CResult_Bolt12OfferContextDecodeErrorZ_get_ok(LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_Bolt12OfferContextDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_Bolt12OfferContextDecodeErrorZ_get_err(LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR owner); @@ -3283,6 +3386,10 @@ public class bindings { public long offers; Offers(long offers) { this.offers = offers; } } + public final static class DNSResolver extends LDKParsedOnionMessageContents { + public long dns_resolver; + DNSResolver(long dns_resolver) { this.dns_resolver = dns_resolver; } + } public final static class Custom extends LDKParsedOnionMessageContents { public long custom; Custom(long custom) { this.custom = custom; } @@ -3337,23 +3444,6 @@ public class bindings { 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); @@ -3503,6 +3593,21 @@ public class bindings { 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); + // struct LDKAsyncPaymentsContext CResult_AsyncPaymentsContextDecodeErrorZ_get_ok(LDKCResult_AsyncPaymentsContextDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_AsyncPaymentsContextDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_AsyncPaymentsContextDecodeErrorZ_get_err(LDKCResult_AsyncPaymentsContextDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_AsyncPaymentsContextDecodeErrorZ_get_err(long owner); + // struct LDKDNSResolverContext CResult_DNSResolverContextDecodeErrorZ_get_ok(LDKCResult_DNSResolverContextDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_DNSResolverContextDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_DNSResolverContextDecodeErrorZ_get_err(LDKCResult_DNSResolverContextDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_DNSResolverContextDecodeErrorZ_get_err(long owner); + public interface LDKMigratableKVStore { + long list_all_keys(); + } + public static native long LDKMigratableKVStore_new(LDKMigratableKVStore impl, LDKKVStore KVStore); + public static native long LDKMigratableKVStore_get_KVStore(long arg); + // LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ MigratableKVStore_list_all_keys LDKMigratableKVStore *NONNULL_PTR this_arg + public static native long MigratableKVStore_list_all_keys(long this_arg); public interface LDKPersister { long persist_manager(long channel_manager); long persist_graph(long network_graph); @@ -3586,6 +3691,15 @@ public class bindings { public static native long LDKEventsProvider_new(LDKEventsProvider impl); // void EventsProvider_process_pending_events LDKEventsProvider *NONNULL_PTR this_arg, struct LDKEventHandler handler public static native void EventsProvider_process_pending_events(long this_arg, long handler); + public interface LDKVerification { + byte[] hmac_for_offer_payment(long nonce, long expanded_key); + long verify_for_offer_payment(byte[] hmac, long nonce, long expanded_key); + } + public static native long LDKVerification_new(LDKVerification impl); + // LDKThirtyTwoBytes Verification_hmac_for_offer_payment LDKVerification *NONNULL_PTR this_arg, struct LDKNonce nonce, const struct LDKExpandedKey *NONNULL_PTR expanded_key + public static native byte[] Verification_hmac_for_offer_payment(long this_arg, long nonce, long expanded_key); + // LDKCResult_NoneNoneZ Verification_verify_for_offer_payment LDKVerification *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes hmac, struct LDKNonce nonce, const struct LDKExpandedKey *NONNULL_PTR expanded_key + public static native long Verification_verify_for_offer_payment(long this_arg, byte[] hmac, long nonce, long expanded_key); public static class LDKFailureCode { private LDKFailureCode() {} public final static class TemporaryNodeFailure extends LDKFailureCode { @@ -3605,6 +3719,20 @@ public class bindings { } static { LDKFailureCode.init(); } public static native LDKFailureCode LDKFailureCode_ref_from_ptr(long ptr); + public static class LDKBolt11InvoiceDescription { + private LDKBolt11InvoiceDescription() {} + public final static class Direct extends LDKBolt11InvoiceDescription { + public long direct; + Direct(long direct) { this.direct = direct; } + } + public final static class Hash extends LDKBolt11InvoiceDescription { + public long hash; + Hash(long hash) { this.hash = hash; } + } + static native void init(); + } + static { LDKBolt11InvoiceDescription.init(); } + public static native LDKBolt11InvoiceDescription LDKBolt11InvoiceDescription_ref_from_ptr(long ptr); public interface LDKMessageSendEventsProvider { long[] get_and_clear_pending_msg_events(); } @@ -3647,6 +3775,7 @@ public class bindings { long provided_node_features(); long provided_init_features(byte[] their_node_id); long get_chain_hashes(); + void message_received(); } public static native long LDKChannelMessageHandler_new(LDKChannelMessageHandler impl, LDKMessageSendEventsProvider MessageSendEventsProvider); public static native long LDKChannelMessageHandler_get_MessageSendEventsProvider(long arg); @@ -3720,6 +3849,8 @@ public class bindings { public static native long ChannelMessageHandler_provided_init_features(long this_arg, byte[] their_node_id); // LDKCOption_CVec_ThirtyTwoBytesZZ ChannelMessageHandler_get_chain_hashes LDKChannelMessageHandler *NONNULL_PTR this_arg public static native long ChannelMessageHandler_get_chain_hashes(long this_arg); + // void ChannelMessageHandler_message_received LDKChannelMessageHandler *NONNULL_PTR this_arg + public static native void ChannelMessageHandler_message_received(long this_arg); public interface LDKOffersMessageHandler { long handle_message(long message, long context, long responder); long[] release_pending_messages(); @@ -3730,17 +3861,32 @@ public class bindings { // 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 handle_held_htlc_available(long message, long responder); + void handle_release_held_htlc(long message, long context); 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); + // LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ AsyncPaymentsMessageHandler_handle_held_htlc_available LDKAsyncPaymentsMessageHandler *NONNULL_PTR this_arg, struct LDKHeldHtlcAvailable message, struct LDKResponder responder + public static native long AsyncPaymentsMessageHandler_handle_held_htlc_available(long this_arg, long message, long responder); + // void AsyncPaymentsMessageHandler_handle_release_held_htlc LDKAsyncPaymentsMessageHandler *NONNULL_PTR this_arg, struct LDKReleaseHeldHtlc message, struct LDKAsyncPaymentsContext context + public static native void AsyncPaymentsMessageHandler_handle_release_held_htlc(long this_arg, long message, long context); // 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 LDKDNSResolverMessageHandler { + long handle_dnssec_query(long message, long responder); + void handle_dnssec_proof(long message, long context); + long provided_node_features(); + long[] release_pending_messages(); + } + public static native long LDKDNSResolverMessageHandler_new(LDKDNSResolverMessageHandler impl); + // LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ DNSResolverMessageHandler_handle_dnssec_query LDKDNSResolverMessageHandler *NONNULL_PTR this_arg, struct LDKDNSSECQuery message, struct LDKResponder responder + public static native long DNSResolverMessageHandler_handle_dnssec_query(long this_arg, long message, long responder); + // void DNSResolverMessageHandler_handle_dnssec_proof LDKDNSResolverMessageHandler *NONNULL_PTR this_arg, struct LDKDNSSECProof message, struct LDKDNSResolverContext context + public static native void DNSResolverMessageHandler_handle_dnssec_proof(long this_arg, long message, long context); + // LDKNodeFeatures DNSResolverMessageHandler_provided_node_features LDKDNSResolverMessageHandler *NONNULL_PTR this_arg + public static native long DNSResolverMessageHandler_provided_node_features(long this_arg); + // LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ DNSResolverMessageHandler_release_pending_messages LDKDNSResolverMessageHandler *NONNULL_PTR this_arg + public static native long[] DNSResolverMessageHandler_release_pending_messages(long this_arg); public interface LDKNodeIdLookUp { byte[] next_node_id(long short_channel_id); } @@ -3748,9 +3894,9 @@ public class bindings { // LDKPublicKey NodeIdLookUp_next_node_id LDKNodeIdLookUp *NONNULL_PTR this_arg, uint64_t short_channel_id public static native byte[] NodeIdLookUp_next_node_id(long this_arg, long short_channel_id); public interface LDKRoutingMessageHandler { - long handle_node_announcement(long msg); - long handle_channel_announcement(long msg); - long handle_channel_update(long msg); + long handle_node_announcement(byte[] their_node_id, long msg); + long handle_channel_announcement(byte[] their_node_id, long msg); + long handle_channel_update(byte[] their_node_id, long msg); long get_next_channel_announcement(long starting_point); long get_next_node_announcement(long starting_point); long peer_connected(byte[] their_node_id, long init, boolean inbound); @@ -3764,12 +3910,12 @@ public class bindings { } public static native long LDKRoutingMessageHandler_new(LDKRoutingMessageHandler impl, LDKMessageSendEventsProvider MessageSendEventsProvider); public static native long LDKRoutingMessageHandler_get_MessageSendEventsProvider(long arg); - // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_node_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg - public static native long RoutingMessageHandler_handle_node_announcement(long this_arg, long msg); - // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg - public static native long RoutingMessageHandler_handle_channel_announcement(long this_arg, long msg); - // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_update LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg - public static native long RoutingMessageHandler_handle_channel_update(long this_arg, long msg); + // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_node_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKNodeAnnouncement *NONNULL_PTR msg + public static native long RoutingMessageHandler_handle_node_announcement(long this_arg, byte[] their_node_id, long msg); + // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelAnnouncement *NONNULL_PTR msg + public static native long RoutingMessageHandler_handle_channel_announcement(long this_arg, byte[] their_node_id, long msg); + // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_update LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg + public static native long RoutingMessageHandler_handle_channel_update(long this_arg, byte[] their_node_id, long msg); // LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ RoutingMessageHandler_get_next_channel_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, uint64_t starting_point public static native long RoutingMessageHandler_get_next_channel_announcement(long this_arg, long starting_point); // LDKNodeAnnouncement RoutingMessageHandler_get_next_node_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKNodeId starting_point @@ -3867,25 +4013,6 @@ 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); } @@ -4176,22 +4303,6 @@ public class bindings { public static native long CResult_RetryDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_clone(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_RetryDecodeErrorZ_clone(long orig); - // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void); - public static native long CResult_NoneAPIErrorZ_ok(); - // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e); - public static native long CResult_NoneAPIErrorZ_err(long e); - // bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o); - public static native boolean CResult_NoneAPIErrorZ_is_ok(long o); - // void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res); - public static native void CResult_NoneAPIErrorZ_free(long _res); - // uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg); - public static native long CResult_NoneAPIErrorZ_clone_ptr(long arg); - // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig); - public static native long CResult_NoneAPIErrorZ_clone(long orig); - // void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res); - public static native void CVec_CResult_NoneAPIErrorZZ_free(long[] _res); - // void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res); - public static native void CVec_APIErrorZ_free(long[] _res); // struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_some(struct LDKThirtyTwoBytes o); public static native long COption_ThirtyTwoBytesZ_some(byte[] o); // struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_none(void); @@ -4246,6 +4357,136 @@ public class bindings { public static native long CResult_RecipientOnionFieldsNoneZ_clone_ptr(long arg); // struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_clone(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR orig); public static native long CResult_RecipientOnionFieldsNoneZ_clone(long orig); + // uint64_t C2Tuple_DNSResolverMessageResponseInstructionZ_clone_ptr(LDKC2Tuple_DNSResolverMessageResponseInstructionZ *NONNULL_PTR arg); + public static native long C2Tuple_DNSResolverMessageResponseInstructionZ_clone_ptr(long arg); + // struct LDKC2Tuple_DNSResolverMessageResponseInstructionZ C2Tuple_DNSResolverMessageResponseInstructionZ_clone(const struct LDKC2Tuple_DNSResolverMessageResponseInstructionZ *NONNULL_PTR orig); + public static native long C2Tuple_DNSResolverMessageResponseInstructionZ_clone(long orig); + // struct LDKC2Tuple_DNSResolverMessageResponseInstructionZ C2Tuple_DNSResolverMessageResponseInstructionZ_new(struct LDKDNSResolverMessage a, struct LDKResponseInstruction b); + public static native long C2Tuple_DNSResolverMessageResponseInstructionZ_new(long a, long b); + // void C2Tuple_DNSResolverMessageResponseInstructionZ_free(struct LDKC2Tuple_DNSResolverMessageResponseInstructionZ _res); + public static native void C2Tuple_DNSResolverMessageResponseInstructionZ_free(long _res); + // struct LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_some(struct LDKC2Tuple_DNSResolverMessageResponseInstructionZ o); + public static native long COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_some(long o); + // struct LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_none(void); + public static native long COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_none(); + // void COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_free(struct LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ _res); + public static native void COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_free(long _res); + // uint64_t COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ *NONNULL_PTR arg); + public static native long COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_clone_ptr(long arg); + // struct LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_clone(const struct LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ *NONNULL_PTR orig); + public static native long COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_clone(long orig); + // uint64_t C2Tuple_DNSResolverMessageMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ *NONNULL_PTR arg); + public static native long C2Tuple_DNSResolverMessageMessageSendInstructionsZ_clone_ptr(long arg); + // struct LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ C2Tuple_DNSResolverMessageMessageSendInstructionsZ_clone(const struct LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ *NONNULL_PTR orig); + public static native long C2Tuple_DNSResolverMessageMessageSendInstructionsZ_clone(long orig); + // struct LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ C2Tuple_DNSResolverMessageMessageSendInstructionsZ_new(struct LDKDNSResolverMessage a, struct LDKMessageSendInstructions b); + public static native long C2Tuple_DNSResolverMessageMessageSendInstructionsZ_new(long a, long b); + // void C2Tuple_DNSResolverMessageMessageSendInstructionsZ_free(struct LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ _res); + public static native void C2Tuple_DNSResolverMessageMessageSendInstructionsZ_free(long _res); + // void CVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ_free(struct LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ _res); + public static native void CVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ_free(long[] _res); + // struct LDKCResult_DNSResolverMessageDecodeErrorZ CResult_DNSResolverMessageDecodeErrorZ_ok(struct LDKDNSResolverMessage o); + public static native long CResult_DNSResolverMessageDecodeErrorZ_ok(long o); + // struct LDKCResult_DNSResolverMessageDecodeErrorZ CResult_DNSResolverMessageDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_DNSResolverMessageDecodeErrorZ_err(long e); + // bool CResult_DNSResolverMessageDecodeErrorZ_is_ok(const struct LDKCResult_DNSResolverMessageDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_DNSResolverMessageDecodeErrorZ_is_ok(long o); + // void CResult_DNSResolverMessageDecodeErrorZ_free(struct LDKCResult_DNSResolverMessageDecodeErrorZ _res); + public static native void CResult_DNSResolverMessageDecodeErrorZ_free(long _res); + // uint64_t CResult_DNSResolverMessageDecodeErrorZ_clone_ptr(LDKCResult_DNSResolverMessageDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_DNSResolverMessageDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_DNSResolverMessageDecodeErrorZ CResult_DNSResolverMessageDecodeErrorZ_clone(const struct LDKCResult_DNSResolverMessageDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_DNSResolverMessageDecodeErrorZ_clone(long orig); + // struct LDKCResult_HumanReadableNameNoneZ CResult_HumanReadableNameNoneZ_ok(struct LDKHumanReadableName o); + public static native long CResult_HumanReadableNameNoneZ_ok(long o); + // struct LDKCResult_HumanReadableNameNoneZ CResult_HumanReadableNameNoneZ_err(void); + public static native long CResult_HumanReadableNameNoneZ_err(); + // bool CResult_HumanReadableNameNoneZ_is_ok(const struct LDKCResult_HumanReadableNameNoneZ *NONNULL_PTR o); + public static native boolean CResult_HumanReadableNameNoneZ_is_ok(long o); + // void CResult_HumanReadableNameNoneZ_free(struct LDKCResult_HumanReadableNameNoneZ _res); + public static native void CResult_HumanReadableNameNoneZ_free(long _res); + // uint64_t CResult_HumanReadableNameNoneZ_clone_ptr(LDKCResult_HumanReadableNameNoneZ *NONNULL_PTR arg); + public static native long CResult_HumanReadableNameNoneZ_clone_ptr(long arg); + // struct LDKCResult_HumanReadableNameNoneZ CResult_HumanReadableNameNoneZ_clone(const struct LDKCResult_HumanReadableNameNoneZ *NONNULL_PTR orig); + public static native long CResult_HumanReadableNameNoneZ_clone(long orig); + // struct LDKCResult_HumanReadableNameDecodeErrorZ CResult_HumanReadableNameDecodeErrorZ_ok(struct LDKHumanReadableName o); + public static native long CResult_HumanReadableNameDecodeErrorZ_ok(long o); + // struct LDKCResult_HumanReadableNameDecodeErrorZ CResult_HumanReadableNameDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_HumanReadableNameDecodeErrorZ_err(long e); + // bool CResult_HumanReadableNameDecodeErrorZ_is_ok(const struct LDKCResult_HumanReadableNameDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_HumanReadableNameDecodeErrorZ_is_ok(long o); + // void CResult_HumanReadableNameDecodeErrorZ_free(struct LDKCResult_HumanReadableNameDecodeErrorZ _res); + public static native void CResult_HumanReadableNameDecodeErrorZ_free(long _res); + // uint64_t CResult_HumanReadableNameDecodeErrorZ_clone_ptr(LDKCResult_HumanReadableNameDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_HumanReadableNameDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_HumanReadableNameDecodeErrorZ CResult_HumanReadableNameDecodeErrorZ_clone(const struct LDKCResult_HumanReadableNameDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_HumanReadableNameDecodeErrorZ_clone(long orig); + // uint64_t C2Tuple_DNSSECQueryDNSResolverContextZ_clone_ptr(LDKC2Tuple_DNSSECQueryDNSResolverContextZ *NONNULL_PTR arg); + public static native long C2Tuple_DNSSECQueryDNSResolverContextZ_clone_ptr(long arg); + // struct LDKC2Tuple_DNSSECQueryDNSResolverContextZ C2Tuple_DNSSECQueryDNSResolverContextZ_clone(const struct LDKC2Tuple_DNSSECQueryDNSResolverContextZ *NONNULL_PTR orig); + public static native long C2Tuple_DNSSECQueryDNSResolverContextZ_clone(long orig); + // struct LDKC2Tuple_DNSSECQueryDNSResolverContextZ C2Tuple_DNSSECQueryDNSResolverContextZ_new(struct LDKDNSSECQuery a, struct LDKDNSResolverContext b); + public static native long C2Tuple_DNSSECQueryDNSResolverContextZ_new(long a, long b); + // void C2Tuple_DNSSECQueryDNSResolverContextZ_free(struct LDKC2Tuple_DNSSECQueryDNSResolverContextZ _res); + public static native void C2Tuple_DNSSECQueryDNSResolverContextZ_free(long _res); + // struct LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_ok(struct LDKC2Tuple_DNSSECQueryDNSResolverContextZ o); + public static native long CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_ok(long o); + // struct LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_err(void); + public static native long CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_err(); + // bool CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_is_ok(const struct LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ *NONNULL_PTR o); + public static native boolean CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_is_ok(long o); + // void CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_free(struct LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ _res); + public static native void CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_free(long _res); + // uint64_t CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_clone_ptr(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ *NONNULL_PTR arg); + public static native long CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_clone_ptr(long arg); + // struct LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_clone(const struct LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ *NONNULL_PTR orig); + public static native long CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_clone(long orig); + // uint64_t C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone_ptr(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ *NONNULL_PTR arg); + public static native long C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone_ptr(long arg); + // struct LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone(const struct LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ *NONNULL_PTR orig); + public static native long C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone(long orig); + // struct LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ C2Tuple_HumanReadableNameThirtyTwoBytesZ_new(struct LDKHumanReadableName a, struct LDKThirtyTwoBytes b); + public static native long C2Tuple_HumanReadableNameThirtyTwoBytesZ_new(long a, byte[] b); + // void C2Tuple_HumanReadableNameThirtyTwoBytesZ_free(struct LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ _res); + public static native void C2Tuple_HumanReadableNameThirtyTwoBytesZ_free(long _res); + // void CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ_free(struct LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ _res); + public static native void CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ_free(long[] _res); + // uint64_t C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone_ptr(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ *NONNULL_PTR arg); + public static native long C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone_ptr(long arg); + // struct LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone(const struct LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ *NONNULL_PTR orig); + public static native long C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone(long orig); + // struct LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_new(struct LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ a, struct LDKOffer b); + public static native long C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_new(long[] a, long b); + // void C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_free(struct LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ _res); + public static native void C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_free(long _res); + // struct LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_some(struct LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ o); + public static native long COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_some(long o); + // struct LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_none(void); + public static native long COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_none(); + // void COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_free(struct LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ _res); + public static native void COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_free(long _res); + // uint64_t COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_clone_ptr(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ *NONNULL_PTR arg); + public static native long COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_clone_ptr(long arg); + // struct LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_clone(const struct LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ *NONNULL_PTR orig); + public static native long COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_clone(long orig); + // uint64_t C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone_ptr(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ *NONNULL_PTR arg); + public static native long C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone_ptr(long arg); + // struct LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone(const struct LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ *NONNULL_PTR orig); + public static native long C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone(long orig); + // struct LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_new(struct LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ a, struct LDKStr b); + public static native long C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_new(long[] a, String b); + // void C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_free(struct LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ _res); + public static native void C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_free(long _res); + // struct LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_some(struct LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ o); + public static native long COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_some(long o); + // struct LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_none(void); + public static native long COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_none(); + // void COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_free(struct LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ _res); + public static native void COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_free(long _res); + // uint64_t COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_clone_ptr(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ *NONNULL_PTR arg); + public static native long COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_clone_ptr(long arg); + // struct LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_clone(const struct LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ *NONNULL_PTR orig); + public static native long COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_clone(long orig); // struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok(struct LDKUnsignedBolt12Invoice o); public static native long CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok(long o); // struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); @@ -4282,6 +4523,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_BlindedPaymentPathZ_free(struct LDKCVec_BlindedPaymentPathZ _res); + public static native void CVec_BlindedPaymentPathZ_free(long[] _res); // 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); @@ -4670,8 +4913,6 @@ 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); - // 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); @@ -4684,34 +4925,6 @@ public class bindings { 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); - public static native long CResult_OnionMessagePathNoneZ_ok(long o); - // struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_err(void); - public static native long CResult_OnionMessagePathNoneZ_err(); - // bool CResult_OnionMessagePathNoneZ_is_ok(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR o); - public static native boolean CResult_OnionMessagePathNoneZ_is_ok(long o); - // void CResult_OnionMessagePathNoneZ_free(struct LDKCResult_OnionMessagePathNoneZ _res); - public static native void CResult_OnionMessagePathNoneZ_free(long _res); - // uint64_t CResult_OnionMessagePathNoneZ_clone_ptr(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR arg); - 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_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); @@ -4818,6 +5031,8 @@ public class bindings { public static native long CResult_RouteHintHopDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_RouteHintHopDecodeErrorZ_clone(long orig); + // void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res); + public static native void CVec_PublicKeyZ_free(byte[][] _res); // struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o); public static native long CResult_FixedPenaltyScorerDecodeErrorZ_ok(long o); // struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e); @@ -4916,112 +5131,28 @@ public class bindings { public static native void CVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ_free(long[] _res); // struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_ok(enum LDKChannelMonitorUpdateStatus o); public static native long CResult_ChannelMonitorUpdateStatusNoneZ_ok(ChannelMonitorUpdateStatus o); - // struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_err(void); - public static native long CResult_ChannelMonitorUpdateStatusNoneZ_err(); - // bool CResult_ChannelMonitorUpdateStatusNoneZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR o); - public static native boolean CResult_ChannelMonitorUpdateStatusNoneZ_is_ok(long o); - // void CResult_ChannelMonitorUpdateStatusNoneZ_free(struct LDKCResult_ChannelMonitorUpdateStatusNoneZ _res); - public static native void CResult_ChannelMonitorUpdateStatusNoneZ_free(long _res); - // uint64_t CResult_ChannelMonitorUpdateStatusNoneZ_clone_ptr(LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR arg); - public static native long CResult_ChannelMonitorUpdateStatusNoneZ_clone_ptr(long arg); - // struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_clone(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR orig); - public static native long CResult_ChannelMonitorUpdateStatusNoneZ_clone(long orig); - // void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res); - public static native void CVec_MonitorEventZ_free(long[] _res); - // uint64_t C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg); - public static native long C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone_ptr(long arg); - // struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig); - public static native long C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(long orig); - // struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKChannelId b, struct LDKCVec_MonitorEventZ c, struct LDKPublicKey d); - public static native long C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(long a, long b, long[] c, byte[] d); - // void C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free(struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ _res); - public static native void C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free(long _res); - // void CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ _res); - public static native void CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(long[] _res); - // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o); - public static native long CResult_InitFeaturesDecodeErrorZ_ok(long o); - // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_InitFeaturesDecodeErrorZ_err(long e); - // bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_InitFeaturesDecodeErrorZ_is_ok(long o); - // void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res); - public static native void CResult_InitFeaturesDecodeErrorZ_free(long _res); - // uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_InitFeaturesDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_InitFeaturesDecodeErrorZ_clone(long orig); - // struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o); - public static native long CResult_ChannelFeaturesDecodeErrorZ_ok(long o); - // struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_ChannelFeaturesDecodeErrorZ_err(long e); - // bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_ChannelFeaturesDecodeErrorZ_is_ok(long o); - // void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res); - public static native void CResult_ChannelFeaturesDecodeErrorZ_free(long _res); - // uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_ChannelFeaturesDecodeErrorZ_clone(long orig); - // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o); - public static native long CResult_NodeFeaturesDecodeErrorZ_ok(long o); - // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_NodeFeaturesDecodeErrorZ_err(long e); - // bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_NodeFeaturesDecodeErrorZ_is_ok(long o); - // void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res); - public static native void CResult_NodeFeaturesDecodeErrorZ_free(long _res); - // uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_NodeFeaturesDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_NodeFeaturesDecodeErrorZ_clone(long orig); - // struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt11InvoiceFeatures o); - public static native long CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(long o); - // struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(long e); - // bool CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(long o); - // void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ _res); - public static native void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(long _res); - // uint64_t CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(long orig); - // struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt12InvoiceFeatures o); - public static native long CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(long o); - // struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(long e); - // bool CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(long o); - // void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ _res); - public static native void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(long _res); - // uint64_t CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(long orig); - // struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_ok(struct LDKBlindedHopFeatures o); - public static native long CResult_BlindedHopFeaturesDecodeErrorZ_ok(long o); - // struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_BlindedHopFeaturesDecodeErrorZ_err(long e); - // bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(long o); - // void CResult_BlindedHopFeaturesDecodeErrorZ_free(struct LDKCResult_BlindedHopFeaturesDecodeErrorZ _res); - public static native void CResult_BlindedHopFeaturesDecodeErrorZ_free(long _res); - // uint64_t CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_clone(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_BlindedHopFeaturesDecodeErrorZ_clone(long orig); - // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o); - public static native long CResult_ChannelTypeFeaturesDecodeErrorZ_ok(long o); - // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_ChannelTypeFeaturesDecodeErrorZ_err(long e); - // bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(long o); - // void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res); - public static native void CResult_ChannelTypeFeaturesDecodeErrorZ_free(long _res); - // uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_ChannelTypeFeaturesDecodeErrorZ_clone(long orig); + // struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_err(void); + public static native long CResult_ChannelMonitorUpdateStatusNoneZ_err(); + // bool CResult_ChannelMonitorUpdateStatusNoneZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR o); + public static native boolean CResult_ChannelMonitorUpdateStatusNoneZ_is_ok(long o); + // void CResult_ChannelMonitorUpdateStatusNoneZ_free(struct LDKCResult_ChannelMonitorUpdateStatusNoneZ _res); + public static native void CResult_ChannelMonitorUpdateStatusNoneZ_free(long _res); + // uint64_t CResult_ChannelMonitorUpdateStatusNoneZ_clone_ptr(LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR arg); + public static native long CResult_ChannelMonitorUpdateStatusNoneZ_clone_ptr(long arg); + // struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_clone(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR orig); + public static native long CResult_ChannelMonitorUpdateStatusNoneZ_clone(long orig); + // void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res); + public static native void CVec_MonitorEventZ_free(long[] _res); + // uint64_t C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg); + public static native long C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone_ptr(long arg); + // struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig); + public static native long C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(long orig); + // struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKChannelId b, struct LDKCVec_MonitorEventZ c, struct LDKPublicKey d); + public static native long C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(long a, long b, long[] c, byte[] d); + // void C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free(struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ _res); + public static native void C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free(long _res); + // void CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ _res); + public static native void CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(long[] _res); // struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_ok(struct LDKOfferId o); public static native long CResult_OfferIdDecodeErrorZ_ok(long o); // struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_err(struct LDKDecodeError e); @@ -5058,22 +5189,14 @@ public class bindings { public static native long CResult_OfferBolt12SemanticErrorZ_clone_ptr(long arg); // struct LDKCResult_OfferBolt12SemanticErrorZ CResult_OfferBolt12SemanticErrorZ_clone(const struct LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR orig); public static native long CResult_OfferBolt12SemanticErrorZ_clone(long orig); - // struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceRequestWithDerivedPayerIdBuilder o); - public static native long CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(long o); - // struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); - public static native long CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(Bolt12SemanticError e); - // bool CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR o); - public static native boolean CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(long o); - // void CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ _res); - public static native void CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(long _res); - // struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceRequestWithExplicitPayerIdBuilder o); - public static native long CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(long o); - // struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); - public static native long CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(Bolt12SemanticError e); - // bool CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR o); - 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_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder o); + public static native long CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_ok(long o); + // struct LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); + public static native long CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_err(Bolt12SemanticError e); + // bool CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR o); + public static native boolean CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(long o); + // void CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ _res); + public static native void CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_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); @@ -5400,18 +5523,18 @@ public class bindings { public static native long CResult_ChannelIdAPIErrorZ_clone(long orig); // void CVec_RecentPaymentDetailsZ_free(struct LDKCVec_RecentPaymentDetailsZ _res); public static native void CVec_RecentPaymentDetailsZ_free(long[] _res); - // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void); - public static native long CResult_NonePaymentSendFailureZ_ok(); - // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e); - public static native long CResult_NonePaymentSendFailureZ_err(long e); - // bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o); - public static native boolean CResult_NonePaymentSendFailureZ_is_ok(long o); - // void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res); - public static native void CResult_NonePaymentSendFailureZ_free(long _res); - // uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg); - public static native long CResult_NonePaymentSendFailureZ_clone_ptr(long arg); - // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig); - public static native long CResult_NonePaymentSendFailureZ_clone(long orig); + // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void); + public static native long CResult_NoneAPIErrorZ_ok(); + // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e); + public static native long CResult_NoneAPIErrorZ_err(long e); + // bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o); + public static native boolean CResult_NoneAPIErrorZ_is_ok(long o); + // void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res); + public static native void CResult_NoneAPIErrorZ_free(long _res); + // uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg); + public static native long CResult_NoneAPIErrorZ_clone_ptr(long arg); + // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig); + public static native long CResult_NoneAPIErrorZ_clone(long orig); // struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_ok(void); public static native long CResult_NoneRetryableSendFailureZ_ok(); // struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_err(enum LDKRetryableSendFailure e); @@ -5424,18 +5547,28 @@ public class bindings { public static native long CResult_NoneRetryableSendFailureZ_clone_ptr(long arg); // struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_clone(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR orig); public static native long CResult_NoneRetryableSendFailureZ_clone(long orig); - // struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o); - public static native long CResult_ThirtyTwoBytesPaymentSendFailureZ_ok(byte[] o); - // struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_err(struct LDKPaymentSendFailure e); - public static native long CResult_ThirtyTwoBytesPaymentSendFailureZ_err(long e); - // bool CResult_ThirtyTwoBytesPaymentSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR o); - public static native boolean CResult_ThirtyTwoBytesPaymentSendFailureZ_is_ok(long o); - // void CResult_ThirtyTwoBytesPaymentSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ _res); - public static native void CResult_ThirtyTwoBytesPaymentSendFailureZ_free(long _res); - // uint64_t CResult_ThirtyTwoBytesPaymentSendFailureZ_clone_ptr(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR arg); - public static native long CResult_ThirtyTwoBytesPaymentSendFailureZ_clone_ptr(long arg); - // struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR orig); - public static native long CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(long orig); + // 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); + // struct LDKCResult_NoneBolt12PaymentErrorZ CResult_NoneBolt12PaymentErrorZ_ok(void); + public static native long CResult_NoneBolt12PaymentErrorZ_ok(); + // struct LDKCResult_NoneBolt12PaymentErrorZ CResult_NoneBolt12PaymentErrorZ_err(struct LDKBolt12PaymentError e); + public static native long CResult_NoneBolt12PaymentErrorZ_err(long e); + // bool CResult_NoneBolt12PaymentErrorZ_is_ok(const struct LDKCResult_NoneBolt12PaymentErrorZ *NONNULL_PTR o); + public static native boolean CResult_NoneBolt12PaymentErrorZ_is_ok(long o); + // void CResult_NoneBolt12PaymentErrorZ_free(struct LDKCResult_NoneBolt12PaymentErrorZ _res); + public static native void CResult_NoneBolt12PaymentErrorZ_free(long _res); + // uint64_t CResult_NoneBolt12PaymentErrorZ_clone_ptr(LDKCResult_NoneBolt12PaymentErrorZ *NONNULL_PTR arg); + public static native long CResult_NoneBolt12PaymentErrorZ_clone_ptr(long arg); + // struct LDKCResult_NoneBolt12PaymentErrorZ CResult_NoneBolt12PaymentErrorZ_clone(const struct LDKCResult_NoneBolt12PaymentErrorZ *NONNULL_PTR orig); + public static native long CResult_NoneBolt12PaymentErrorZ_clone(long orig); // struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_ok(struct LDKThirtyTwoBytes o); public static native long CResult_ThirtyTwoBytesRetryableSendFailureZ_ok(byte[] o); // struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_err(enum LDKRetryableSendFailure e); @@ -5456,18 +5589,18 @@ public class bindings { public static native long C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_new(byte[] a, byte[] b); // void C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_free(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ _res); public static native void C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_free(long _res); - // struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o); - public static native long CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(long o); - // struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e); - public static native long CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_err(long e); - // bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR o); - public static native boolean CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok(long o); - // void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ _res); - public static native void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free(long _res); - // uint64_t CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR arg); - public static native long CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone_ptr(long arg); - // struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR orig); - public static native long CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(long orig); + // struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o); + public static native long CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_ok(long o); + // struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_err(struct LDKProbeSendFailure e); + public static native long CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_err(long e); + // bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ *NONNULL_PTR o); + public static native boolean CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_is_ok(long o); + // void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ _res); + public static native void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_free(long _res); + // uint64_t CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_clone_ptr(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ *NONNULL_PTR arg); + public static native long CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_clone_ptr(long arg); + // struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ *NONNULL_PTR orig); + public static native long CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_clone(long orig); // void CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ _res); public static native void CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ_free(long[] _res); // struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ o); @@ -5494,6 +5627,36 @@ public class bindings { public static native void CVec_C2Tuple_ChannelIdPublicKeyZZ_free(long[] _res); // void CVec_ChannelIdZ_free(struct LDKCVec_ChannelIdZ _res); public static native void CVec_ChannelIdZ_free(long[] _res); + // uint64_t C2Tuple_PublicKeyChannelIdZ_clone_ptr(LDKC2Tuple_PublicKeyChannelIdZ *NONNULL_PTR arg); + public static native long C2Tuple_PublicKeyChannelIdZ_clone_ptr(long arg); + // struct LDKC2Tuple_PublicKeyChannelIdZ C2Tuple_PublicKeyChannelIdZ_clone(const struct LDKC2Tuple_PublicKeyChannelIdZ *NONNULL_PTR orig); + public static native long C2Tuple_PublicKeyChannelIdZ_clone(long orig); + // struct LDKC2Tuple_PublicKeyChannelIdZ C2Tuple_PublicKeyChannelIdZ_new(struct LDKPublicKey a, struct LDKChannelId b); + public static native long C2Tuple_PublicKeyChannelIdZ_new(byte[] a, long b); + // void C2Tuple_PublicKeyChannelIdZ_free(struct LDKC2Tuple_PublicKeyChannelIdZ _res); + public static native void C2Tuple_PublicKeyChannelIdZ_free(long _res); + // struct LDKCOption_C2Tuple_PublicKeyChannelIdZZ COption_C2Tuple_PublicKeyChannelIdZZ_some(struct LDKC2Tuple_PublicKeyChannelIdZ o); + public static native long COption_C2Tuple_PublicKeyChannelIdZZ_some(long o); + // struct LDKCOption_C2Tuple_PublicKeyChannelIdZZ COption_C2Tuple_PublicKeyChannelIdZZ_none(void); + public static native long COption_C2Tuple_PublicKeyChannelIdZZ_none(); + // void COption_C2Tuple_PublicKeyChannelIdZZ_free(struct LDKCOption_C2Tuple_PublicKeyChannelIdZZ _res); + public static native void COption_C2Tuple_PublicKeyChannelIdZZ_free(long _res); + // uint64_t COption_C2Tuple_PublicKeyChannelIdZZ_clone_ptr(LDKCOption_C2Tuple_PublicKeyChannelIdZZ *NONNULL_PTR arg); + public static native long COption_C2Tuple_PublicKeyChannelIdZZ_clone_ptr(long arg); + // struct LDKCOption_C2Tuple_PublicKeyChannelIdZZ COption_C2Tuple_PublicKeyChannelIdZZ_clone(const struct LDKCOption_C2Tuple_PublicKeyChannelIdZZ *NONNULL_PTR orig); + public static native long COption_C2Tuple_PublicKeyChannelIdZZ_clone(long orig); + // 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_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(struct LDKOfferWithDerivedMetadataBuilder o); public static native long CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(long o); // struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); @@ -5516,6 +5679,8 @@ public class bindings { public static native long COption_StrZ_clone_ptr(long arg); // struct LDKCOption_StrZ COption_StrZ_clone(const struct LDKCOption_StrZ *NONNULL_PTR orig); public static native long COption_StrZ_clone(long orig); + // void CVec_DestinationZ_free(struct LDKCVec_DestinationZ _res); + public static native void CVec_DestinationZ_free(long[] _res); // struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o); public static native long CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(long o); // struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_err(void); @@ -5540,16 +5705,6 @@ 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_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); @@ -5844,6 +5999,14 @@ public class bindings { public static native void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_free(long _res); // void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ _res); public static native void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ_free(long[] _res); + // uint64_t C2Tuple_boolboolZ_clone_ptr(LDKC2Tuple_boolboolZ *NONNULL_PTR arg); + public static native long C2Tuple_boolboolZ_clone_ptr(long arg); + // struct LDKC2Tuple_boolboolZ C2Tuple_boolboolZ_clone(const struct LDKC2Tuple_boolboolZ *NONNULL_PTR orig); + public static native long C2Tuple_boolboolZ_clone(long orig); + // struct LDKC2Tuple_boolboolZ C2Tuple_boolboolZ_new(bool a, bool b); + public static native long C2Tuple_boolboolZ_new(boolean a, boolean b); + // void C2Tuple_boolboolZ_free(struct LDKC2Tuple_boolboolZ _res); + public static native void C2Tuple_boolboolZ_free(long _res); // void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res); public static native void CVec_BalanceZ_free(long[] _res); // uint64_t C2Tuple_ThirtyTwoBytesChannelMonitorZ_clone_ptr(LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *NONNULL_PTR arg); @@ -6028,6 +6191,28 @@ public class bindings { public static native long CResult_CVec_StrZIOErrorZ_clone_ptr(long arg); // struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_clone(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR orig); public static native long CResult_CVec_StrZIOErrorZ_clone(long orig); + // uint64_t C3Tuple_StrStrStrZ_clone_ptr(LDKC3Tuple_StrStrStrZ *NONNULL_PTR arg); + public static native long C3Tuple_StrStrStrZ_clone_ptr(long arg); + // struct LDKC3Tuple_StrStrStrZ C3Tuple_StrStrStrZ_clone(const struct LDKC3Tuple_StrStrStrZ *NONNULL_PTR orig); + public static native long C3Tuple_StrStrStrZ_clone(long orig); + // struct LDKC3Tuple_StrStrStrZ C3Tuple_StrStrStrZ_new(struct LDKStr a, struct LDKStr b, struct LDKStr c); + public static native long C3Tuple_StrStrStrZ_new(String a, String b, String c); + // void C3Tuple_StrStrStrZ_free(struct LDKC3Tuple_StrStrStrZ _res); + public static native void C3Tuple_StrStrStrZ_free(long _res); + // void CVec_C3Tuple_StrStrStrZZ_free(struct LDKCVec_C3Tuple_StrStrStrZZ _res); + public static native void CVec_C3Tuple_StrStrStrZZ_free(long[] _res); + // struct LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_ok(struct LDKCVec_C3Tuple_StrStrStrZZ o); + public static native long CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_ok(long[] o); + // struct LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_err(enum LDKIOError e); + public static native long CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_err(IOError e); + // bool CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_is_ok(const struct LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ *NONNULL_PTR o); + public static native boolean CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_is_ok(long o); + // void CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_free(struct LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ _res); + public static native void CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_free(long _res); + // uint64_t CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_clone_ptr(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ *NONNULL_PTR arg); + public static native long CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_clone_ptr(long arg); + // struct LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_clone(const struct LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ *NONNULL_PTR orig); + public static native long CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_clone(long orig); // void CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ _res); public static native void CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ_free(long[] _res); // struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ o); @@ -6054,18 +6239,22 @@ public class bindings { public static native long CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone_ptr(long arg); // struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR orig); public static native long CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(long orig); - // struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(struct LDKUnsignedInvoiceRequest o); - public static native long CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(long o); - // struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); - public static native long CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(Bolt12SemanticError e); - // bool CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(const struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR o); - public static native boolean CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(long o); - // void CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ _res); - public static native void CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(long _res); - // uint64_t CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR arg); - public static native long CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(long arg); - // struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(const struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR orig); - public static native long CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(long orig); + // struct LDKCResult_MonitorNameIOErrorZ CResult_MonitorNameIOErrorZ_ok(struct LDKMonitorName o); + public static native long CResult_MonitorNameIOErrorZ_ok(long o); + // struct LDKCResult_MonitorNameIOErrorZ CResult_MonitorNameIOErrorZ_err(enum LDKIOError e); + public static native long CResult_MonitorNameIOErrorZ_err(IOError e); + // bool CResult_MonitorNameIOErrorZ_is_ok(const struct LDKCResult_MonitorNameIOErrorZ *NONNULL_PTR o); + public static native boolean CResult_MonitorNameIOErrorZ_is_ok(long o); + // void CResult_MonitorNameIOErrorZ_free(struct LDKCResult_MonitorNameIOErrorZ _res); + public static native void CResult_MonitorNameIOErrorZ_free(long _res); + // struct LDKCResult_UpdateNameIOErrorZ CResult_UpdateNameIOErrorZ_ok(struct LDKUpdateName o); + public static native long CResult_UpdateNameIOErrorZ_ok(long o); + // struct LDKCResult_UpdateNameIOErrorZ CResult_UpdateNameIOErrorZ_err(enum LDKIOError e); + public static native long CResult_UpdateNameIOErrorZ_err(IOError e); + // bool CResult_UpdateNameIOErrorZ_is_ok(const struct LDKCResult_UpdateNameIOErrorZ *NONNULL_PTR o); + public static native boolean CResult_UpdateNameIOErrorZ_is_ok(long o); + // void CResult_UpdateNameIOErrorZ_free(struct LDKCResult_UpdateNameIOErrorZ _res); + public static native void CResult_UpdateNameIOErrorZ_free(long _res); // struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_ok(struct LDKInvoiceRequest o); public static native long CResult_InvoiceRequestBolt12SemanticErrorZ_ok(long o); // struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); @@ -6106,6 +6295,18 @@ public class bindings { public static native boolean CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(long o); // void CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ _res); public static native void CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(long _res); + // struct LDKCResult_InvoiceRequestDecodeErrorZ CResult_InvoiceRequestDecodeErrorZ_ok(struct LDKInvoiceRequest o); + public static native long CResult_InvoiceRequestDecodeErrorZ_ok(long o); + // struct LDKCResult_InvoiceRequestDecodeErrorZ CResult_InvoiceRequestDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_InvoiceRequestDecodeErrorZ_err(long e); + // bool CResult_InvoiceRequestDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceRequestDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_InvoiceRequestDecodeErrorZ_is_ok(long o); + // void CResult_InvoiceRequestDecodeErrorZ_free(struct LDKCResult_InvoiceRequestDecodeErrorZ _res); + public static native void CResult_InvoiceRequestDecodeErrorZ_free(long _res); + // uint64_t CResult_InvoiceRequestDecodeErrorZ_clone_ptr(LDKCResult_InvoiceRequestDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_InvoiceRequestDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_InvoiceRequestDecodeErrorZ CResult_InvoiceRequestDecodeErrorZ_clone(const struct LDKCResult_InvoiceRequestDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_InvoiceRequestDecodeErrorZ_clone(long orig); // struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_ok(struct LDKInvoiceRequestFields o); public static native long CResult_InvoiceRequestFieldsDecodeErrorZ_ok(long o); // struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_err(struct LDKDecodeError e); @@ -7534,6 +7735,90 @@ public class bindings { public static native long CResult_ChannelIdDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_clone(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ChannelIdDecodeErrorZ_clone(long orig); + // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o); + public static native long CResult_InitFeaturesDecodeErrorZ_ok(long o); + // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_InitFeaturesDecodeErrorZ_err(long e); + // bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_InitFeaturesDecodeErrorZ_is_ok(long o); + // void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res); + public static native void CResult_InitFeaturesDecodeErrorZ_free(long _res); + // uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_InitFeaturesDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_InitFeaturesDecodeErrorZ_clone(long orig); + // struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o); + public static native long CResult_ChannelFeaturesDecodeErrorZ_ok(long o); + // struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_ChannelFeaturesDecodeErrorZ_err(long e); + // bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ChannelFeaturesDecodeErrorZ_is_ok(long o); + // void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res); + public static native void CResult_ChannelFeaturesDecodeErrorZ_free(long _res); + // uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_ChannelFeaturesDecodeErrorZ_clone(long orig); + // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o); + public static native long CResult_NodeFeaturesDecodeErrorZ_ok(long o); + // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_NodeFeaturesDecodeErrorZ_err(long e); + // bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_NodeFeaturesDecodeErrorZ_is_ok(long o); + // void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res); + public static native void CResult_NodeFeaturesDecodeErrorZ_free(long _res); + // uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_NodeFeaturesDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_NodeFeaturesDecodeErrorZ_clone(long orig); + // struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt11InvoiceFeatures o); + public static native long CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(long o); + // struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(long e); + // bool CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(long o); + // void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ _res); + public static native void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(long _res); + // uint64_t CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(long orig); + // struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt12InvoiceFeatures o); + public static native long CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(long o); + // struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(long e); + // bool CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(long o); + // void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ _res); + public static native void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(long _res); + // uint64_t CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(long orig); + // struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_ok(struct LDKBlindedHopFeatures o); + public static native long CResult_BlindedHopFeaturesDecodeErrorZ_ok(long o); + // struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_BlindedHopFeaturesDecodeErrorZ_err(long e); + // bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(long o); + // void CResult_BlindedHopFeaturesDecodeErrorZ_free(struct LDKCResult_BlindedHopFeaturesDecodeErrorZ _res); + public static native void CResult_BlindedHopFeaturesDecodeErrorZ_free(long _res); + // uint64_t CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_clone(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_BlindedHopFeaturesDecodeErrorZ_clone(long orig); + // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o); + public static native long CResult_ChannelTypeFeaturesDecodeErrorZ_ok(long o); + // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_ChannelTypeFeaturesDecodeErrorZ_err(long e); + // bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(long o); + // void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res); + public static native void CResult_ChannelTypeFeaturesDecodeErrorZ_free(long _res); + // uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_ChannelTypeFeaturesDecodeErrorZ_clone(long orig); // uint64_t C2Tuple__u832u16Z_clone_ptr(LDKC2Tuple__u832u16Z *NONNULL_PTR arg); public static native long C2Tuple__u832u16Z_clone_ptr(long arg); // struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_clone(const struct LDKC2Tuple__u832u16Z *NONNULL_PTR orig); @@ -7604,18 +7889,6 @@ public class bindings { public static native long CResult_PaymentContextDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_clone(const struct LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_PaymentContextDecodeErrorZ_clone(long orig); - // struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_ok(struct LDKUnknownPaymentContext o); - public static native long CResult_UnknownPaymentContextDecodeErrorZ_ok(long o); - // struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_UnknownPaymentContextDecodeErrorZ_err(long e); - // bool CResult_UnknownPaymentContextDecodeErrorZ_is_ok(const struct LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_UnknownPaymentContextDecodeErrorZ_is_ok(long o); - // void CResult_UnknownPaymentContextDecodeErrorZ_free(struct LDKCResult_UnknownPaymentContextDecodeErrorZ _res); - public static native void CResult_UnknownPaymentContextDecodeErrorZ_free(long _res); - // uint64_t CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_clone(const struct LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_UnknownPaymentContextDecodeErrorZ_clone(long orig); // struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_ok(struct LDKBolt12OfferContext o); public static native long CResult_Bolt12OfferContextDecodeErrorZ_ok(long o); // struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_err(struct LDKDecodeError e); @@ -7664,6 +7937,32 @@ public class bindings { 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 LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_ok(struct LDKOnionMessagePath o); + public static native long CResult_OnionMessagePathNoneZ_ok(long o); + // struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_err(void); + public static native long CResult_OnionMessagePathNoneZ_err(); + // bool CResult_OnionMessagePathNoneZ_is_ok(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR o); + public static native boolean CResult_OnionMessagePathNoneZ_is_ok(long o); + // void CResult_OnionMessagePathNoneZ_free(struct LDKCResult_OnionMessagePathNoneZ _res); + public static native void CResult_OnionMessagePathNoneZ_free(long _res); + // uint64_t CResult_OnionMessagePathNoneZ_clone_ptr(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR arg); + 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_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 LDKCOption_MessageContextZ COption_MessageContextZ_some(struct LDKMessageContext o); public static native long COption_MessageContextZ_some(long o); // struct LDKCOption_MessageContextZ COption_MessageContextZ_none(void); @@ -7744,18 +8043,6 @@ public class bindings { 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); @@ -7968,6 +8255,30 @@ public class bindings { 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); + // struct LDKCResult_AsyncPaymentsContextDecodeErrorZ CResult_AsyncPaymentsContextDecodeErrorZ_ok(struct LDKAsyncPaymentsContext o); + public static native long CResult_AsyncPaymentsContextDecodeErrorZ_ok(long o); + // struct LDKCResult_AsyncPaymentsContextDecodeErrorZ CResult_AsyncPaymentsContextDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_AsyncPaymentsContextDecodeErrorZ_err(long e); + // bool CResult_AsyncPaymentsContextDecodeErrorZ_is_ok(const struct LDKCResult_AsyncPaymentsContextDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_AsyncPaymentsContextDecodeErrorZ_is_ok(long o); + // void CResult_AsyncPaymentsContextDecodeErrorZ_free(struct LDKCResult_AsyncPaymentsContextDecodeErrorZ _res); + public static native void CResult_AsyncPaymentsContextDecodeErrorZ_free(long _res); + // uint64_t CResult_AsyncPaymentsContextDecodeErrorZ_clone_ptr(LDKCResult_AsyncPaymentsContextDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_AsyncPaymentsContextDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_AsyncPaymentsContextDecodeErrorZ CResult_AsyncPaymentsContextDecodeErrorZ_clone(const struct LDKCResult_AsyncPaymentsContextDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_AsyncPaymentsContextDecodeErrorZ_clone(long orig); + // struct LDKCResult_DNSResolverContextDecodeErrorZ CResult_DNSResolverContextDecodeErrorZ_ok(struct LDKDNSResolverContext o); + public static native long CResult_DNSResolverContextDecodeErrorZ_ok(long o); + // struct LDKCResult_DNSResolverContextDecodeErrorZ CResult_DNSResolverContextDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_DNSResolverContextDecodeErrorZ_err(long e); + // bool CResult_DNSResolverContextDecodeErrorZ_is_ok(const struct LDKCResult_DNSResolverContextDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_DNSResolverContextDecodeErrorZ_is_ok(long o); + // void CResult_DNSResolverContextDecodeErrorZ_free(struct LDKCResult_DNSResolverContextDecodeErrorZ _res); + public static native void CResult_DNSResolverContextDecodeErrorZ_free(long _res); + // uint64_t CResult_DNSResolverContextDecodeErrorZ_clone_ptr(LDKCResult_DNSResolverContextDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_DNSResolverContextDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_DNSResolverContextDecodeErrorZ CResult_DNSResolverContextDecodeErrorZ_clone(const struct LDKCResult_DNSResolverContextDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_DNSResolverContextDecodeErrorZ_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); @@ -8062,6 +8373,10 @@ public class bindings { public static native boolean verify(byte[] msg, String sig, byte[] pk); // void KVStore_free(struct LDKKVStore this_ptr); public static native void KVStore_free(long this_ptr); + // void MigratableKVStore_free(struct LDKMigratableKVStore this_ptr); + public static native void MigratableKVStore_free(long this_ptr); + // struct LDKCResult_NoneIOErrorZ migrate_kv_store_data(struct LDKMigratableKVStore *NONNULL_PTR source_store, struct LDKMigratableKVStore *NONNULL_PTR target_store); + public static native long migrate_kv_store_data(long source_store, long target_store); // void Persister_free(struct LDKPersister this_ptr); public static native void Persister_free(long this_ptr); // struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ read_channel_monitors(struct LDKKVStore kv_store, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider); @@ -8078,6 +8393,22 @@ public class bindings { 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); public static native long MonitorUpdatingPersister_as_Persist(long this_arg); + // void MonitorName_free(struct LDKMonitorName this_obj); + public static native void MonitorName_free(long this_obj); + // MUST_USE_RES struct LDKCResult_MonitorNameIOErrorZ MonitorName_new(struct LDKStr name); + public static native long MonitorName_new(String name); + // MUST_USE_RES struct LDKStr MonitorName_as_str(const struct LDKMonitorName *NONNULL_PTR this_arg); + public static native String MonitorName_as_str(long this_arg); + // void UpdateName_free(struct LDKUpdateName this_obj); + public static native void UpdateName_free(long this_obj); + // uint64_t UpdateName_get_a(const struct LDKUpdateName *NONNULL_PTR this_ptr); + public static native long UpdateName_get_a(long this_ptr); + // void UpdateName_set_a(struct LDKUpdateName *NONNULL_PTR this_ptr, uint64_t val); + public static native void UpdateName_set_a(long this_ptr, long val); + // MUST_USE_RES struct LDKCResult_UpdateNameIOErrorZ UpdateName_new(struct LDKStr name); + public static native long UpdateName_new(String name); + // MUST_USE_RES struct LDKStr UpdateName_as_str(const struct LDKUpdateName *NONNULL_PTR this_arg); + public static native String UpdateName_as_str(long this_arg); // enum LDKShortChannelIdError ShortChannelIdError_clone(const enum LDKShortChannelIdError *NONNULL_PTR orig); public static native ShortChannelIdError ShortChannelIdError_clone(long orig); // enum LDKShortChannelIdError ShortChannelIdError_block_overflow(void); @@ -8470,16 +8801,12 @@ public class bindings { public static native boolean UserConfig_get_accept_intercept_htlcs(long this_ptr); // void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val); public static native void UserConfig_set_accept_intercept_htlcs(long this_ptr, boolean val); - // bool UserConfig_get_accept_mpp_keysend(const struct LDKUserConfig *NONNULL_PTR this_ptr); - 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); // 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); + // 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 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 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); @@ -8722,8 +9049,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); - // 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 LDKCResult_NoneReplayEventZ ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler, const struct LDKLogger *NONNULL_PTR logger); + public static native long ChannelMonitor_process_pending_events(long this_arg, long handler, long logger); // 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); @@ -8756,8 +9083,8 @@ public class bindings { 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); public static native long[] ChannelMonitor_get_spendable_outputs(long this_arg, byte[] tx, int confirmation_height); - // MUST_USE_RES bool ChannelMonitor_is_fully_resolved(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger); - public static native boolean ChannelMonitor_is_fully_resolved(long this_arg, long logger); + // MUST_USE_RES struct LDKC2Tuple_boolboolZ ChannelMonitor_check_and_update_full_resolution_status(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger); + public static native long ChannelMonitor_check_and_update_full_resolution_status(long this_arg, long logger); // MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg); public static native long[] ChannelMonitor_get_claimable_balances(long this_arg); // struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKEntropySource *NONNULL_PTR arg_a, const struct LDKSignerProvider *NONNULL_PTR arg_b); @@ -8812,8 +9139,8 @@ 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, 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); + // struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ peel_payment_onion(const struct LDKUpdateAddHTLC *NONNULL_PTR msg, struct LDKNodeSigner node_signer, struct LDKLogger logger, uint32_t cur_height, bool allow_skimmed_fees); + public static native long peel_payment_onion(long msg, long node_signer, long logger, int cur_height, boolean allow_skimmed_fees); // void PendingHTLCRouting_free(struct LDKPendingHTLCRouting this_ptr); public static native void PendingHTLCRouting_free(long this_ptr); // uint64_t PendingHTLCRouting_clone_ptr(LDKPendingHTLCRouting *NONNULL_PTR arg); @@ -8824,8 +9151,8 @@ public class bindings { public static native long PendingHTLCRouting_forward(long onion_packet, long short_channel_id, long blinded); // struct LDKPendingHTLCRouting PendingHTLCRouting_receive(struct LDKFinalOnionHopData payment_data, struct LDKCOption_CVec_u8ZZ payment_metadata, struct LDKCOption_PaymentContextZ payment_context, uint32_t incoming_cltv_expiry, struct LDKThirtyTwoBytes phantom_shared_secret, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs, bool requires_blinded_error); public static native long PendingHTLCRouting_receive(long payment_data, long payment_metadata, long payment_context, int incoming_cltv_expiry, byte[] phantom_shared_secret, long[] custom_tlvs, boolean requires_blinded_error); - // struct LDKPendingHTLCRouting PendingHTLCRouting_receive_keysend(struct LDKFinalOnionHopData payment_data, struct LDKThirtyTwoBytes payment_preimage, struct LDKCOption_CVec_u8ZZ payment_metadata, uint32_t incoming_cltv_expiry, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs, bool requires_blinded_error); - public static native long PendingHTLCRouting_receive_keysend(long payment_data, byte[] payment_preimage, long payment_metadata, int incoming_cltv_expiry, long[] custom_tlvs, boolean requires_blinded_error); + // struct LDKPendingHTLCRouting PendingHTLCRouting_receive_keysend(struct LDKFinalOnionHopData payment_data, struct LDKThirtyTwoBytes payment_preimage, struct LDKCOption_CVec_u8ZZ payment_metadata, uint32_t incoming_cltv_expiry, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs, bool requires_blinded_error, bool has_recipient_created_payment_secret); + public static native long PendingHTLCRouting_receive_keysend(long payment_data, byte[] payment_preimage, long payment_metadata, int incoming_cltv_expiry, long[] custom_tlvs, boolean requires_blinded_error, boolean has_recipient_created_payment_secret); // void BlindedForward_free(struct LDKBlindedForward this_obj); public static native void BlindedForward_free(long this_obj); // struct LDKPublicKey BlindedForward_get_inbound_blinding_point(const struct LDKBlindedForward *NONNULL_PTR this_ptr); @@ -8896,6 +9223,10 @@ public class bindings { public static native long BlindedFailure_hash(long o); // bool BlindedFailure_eq(const enum LDKBlindedFailure *NONNULL_PTR a, const enum LDKBlindedFailure *NONNULL_PTR b); public static native boolean BlindedFailure_eq(long a, long b); + // void Verification_free(struct LDKVerification this_ptr); + public static native void Verification_free(long this_ptr); + // struct LDKVerification UnauthenticatedReceiveTlvs_as_Verification(const struct LDKUnauthenticatedReceiveTlvs *NONNULL_PTR this_arg); + public static native long UnauthenticatedReceiveTlvs_as_Verification(long this_arg); // void FailureCode_free(struct LDKFailureCode this_ptr); public static native void FailureCode_free(long this_ptr); // uint64_t FailureCode_clone_ptr(LDKFailureCode *NONNULL_PTR arg); @@ -8962,8 +9293,8 @@ public class bindings { public static native long PhantomRouteHints_clone_ptr(long arg); // struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig); public static native long PhantomRouteHints_clone(long orig); - // MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKRouter router, struct LDKLogger logger, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKSignerProvider signer_provider, struct LDKUserConfig config, struct LDKChainParameters params, uint32_t current_timestamp); - public static native long ChannelManager_new(long fee_est, long chain_monitor, long tx_broadcaster, long router, long logger, long entropy_source, long node_signer, long signer_provider, long config, long params, int current_timestamp); + // MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKRouter router, struct LDKMessageRouter message_router, struct LDKLogger logger, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKSignerProvider signer_provider, struct LDKUserConfig config, struct LDKChainParameters params, uint32_t current_timestamp); + public static native long ChannelManager_new(long fee_est, long chain_monitor, long tx_broadcaster, long router, long message_router, long logger, long entropy_source, long node_signer, long signer_provider, long config, long params, int current_timestamp); // MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native long ChannelManager_get_current_default_configuration(long this_arg); // MUST_USE_RES struct LDKCResult_ChannelIdAPIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, struct LDKU128 user_channel_id, struct LDKChannelId temporary_channel_id, struct LDKUserConfig override_config); @@ -8988,17 +9319,15 @@ public class bindings { 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); + // MUST_USE_RES struct LDKCResult_NoneBolt12PaymentErrorZ ChannelManager_send_payment_for_bolt12_invoice(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKBolt12Invoice *NONNULL_PTR invoice, struct LDKCOption_OffersContextZ context); + public static native long ChannelManager_send_payment_for_bolt12_invoice(long this_arg, long invoice, long context); // void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id); public static native void ChannelManager_abandon_payment(long this_arg, byte[] payment_id); - // MUST_USE_RES struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id); - public static native long ChannelManager_send_spontaneous_payment(long this_arg, long route, long payment_preimage, long recipient_onion, byte[] payment_id); - // MUST_USE_RES struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ ChannelManager_send_spontaneous_payment_with_retry(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy); - public static native long ChannelManager_send_spontaneous_payment_with_retry(long this_arg, long payment_preimage, long recipient_onion, byte[] payment_id, long route_params, long retry_strategy); - // MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path); + // MUST_USE_RES struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy); + public static native long ChannelManager_send_spontaneous_payment(long this_arg, long payment_preimage, long recipient_onion, byte[] payment_id, long route_params, long retry_strategy); + // MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path); public static native long ChannelManager_send_probe(long this_arg, long path); // MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ChannelManager_send_spontaneous_preflight_probes(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, uint64_t amount_msat, uint32_t final_cltv_expiry_delta, struct LDKCOption_u64Z liquidity_limit_multiplier); 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); @@ -9036,6 +9365,36 @@ 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); + // void ChannelManager_signer_unblocked(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_C2Tuple_PublicKeyChannelIdZZ channel_opt); + public static native void ChannelManager_signer_unblocked(long this_arg, long channel_opt); + // MUST_USE_RES struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ ChannelManager_create_bolt11_invoice(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKBolt11InvoiceParameters params); + public static native long ChannelManager_create_bolt11_invoice(long this_arg, long params); + // void Bolt11InvoiceParameters_free(struct LDKBolt11InvoiceParameters this_obj); + public static native void Bolt11InvoiceParameters_free(long this_obj); + // struct LDKCOption_u64Z Bolt11InvoiceParameters_get_amount_msats(const struct LDKBolt11InvoiceParameters *NONNULL_PTR this_ptr); + public static native long Bolt11InvoiceParameters_get_amount_msats(long this_ptr); + // void Bolt11InvoiceParameters_set_amount_msats(struct LDKBolt11InvoiceParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + public static native void Bolt11InvoiceParameters_set_amount_msats(long this_ptr, long val); + // struct LDKBolt11InvoiceDescription Bolt11InvoiceParameters_get_description(const struct LDKBolt11InvoiceParameters *NONNULL_PTR this_ptr); + public static native long Bolt11InvoiceParameters_get_description(long this_ptr); + // void Bolt11InvoiceParameters_set_description(struct LDKBolt11InvoiceParameters *NONNULL_PTR this_ptr, struct LDKBolt11InvoiceDescription val); + public static native void Bolt11InvoiceParameters_set_description(long this_ptr, long val); + // struct LDKCOption_u32Z Bolt11InvoiceParameters_get_invoice_expiry_delta_secs(const struct LDKBolt11InvoiceParameters *NONNULL_PTR this_ptr); + public static native long Bolt11InvoiceParameters_get_invoice_expiry_delta_secs(long this_ptr); + // void Bolt11InvoiceParameters_set_invoice_expiry_delta_secs(struct LDKBolt11InvoiceParameters *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); + public static native void Bolt11InvoiceParameters_set_invoice_expiry_delta_secs(long this_ptr, long val); + // struct LDKCOption_u16Z Bolt11InvoiceParameters_get_min_final_cltv_expiry_delta(const struct LDKBolt11InvoiceParameters *NONNULL_PTR this_ptr); + public static native long Bolt11InvoiceParameters_get_min_final_cltv_expiry_delta(long this_ptr); + // void Bolt11InvoiceParameters_set_min_final_cltv_expiry_delta(struct LDKBolt11InvoiceParameters *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val); + public static native void Bolt11InvoiceParameters_set_min_final_cltv_expiry_delta(long this_ptr, long val); + // struct LDKCOption_ThirtyTwoBytesZ Bolt11InvoiceParameters_get_payment_hash(const struct LDKBolt11InvoiceParameters *NONNULL_PTR this_ptr); + public static native long Bolt11InvoiceParameters_get_payment_hash(long this_ptr); + // void Bolt11InvoiceParameters_set_payment_hash(struct LDKBolt11InvoiceParameters *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val); + public static native void Bolt11InvoiceParameters_set_payment_hash(long this_ptr, long val); + // MUST_USE_RES struct LDKBolt11InvoiceParameters Bolt11InvoiceParameters_new(struct LDKCOption_u64Z amount_msats_arg, struct LDKBolt11InvoiceDescription description_arg, struct LDKCOption_u32Z invoice_expiry_delta_secs_arg, struct LDKCOption_u16Z min_final_cltv_expiry_delta_arg, struct LDKCOption_ThirtyTwoBytesZ payment_hash_arg); + public static native long Bolt11InvoiceParameters_new(long amount_msats_arg, long description_arg, long invoice_expiry_delta_secs_arg, long min_final_cltv_expiry_delta_arg, long payment_hash_arg); + // MUST_USE_RES struct LDKBolt11InvoiceParameters Bolt11InvoiceParameters_default(void); + public static native long Bolt11InvoiceParameters_default(); // 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); @@ -9044,6 +9403,8 @@ public class bindings { public static native long ChannelManager_pay_for_offer(long this_arg, long offer, long quantity, long amount_msats, long payer_note, byte[] payment_id, long retry_strategy, long max_total_routing_fee_msat); // MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ ChannelManager_request_refund_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRefund *NONNULL_PTR refund); public static native long ChannelManager_request_refund_payment(long this_arg, long refund); + // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelManager_pay_for_offer_from_human_readable_name(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKHumanReadableName name, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, struct LDKCOption_u64Z max_total_routing_fee_msat, struct LDKCVec_DestinationZ dns_resolvers); + public static native long ChannelManager_pay_for_offer_from_human_readable_name(long this_arg, long name, long amount_msats, byte[] payment_id, long retry_strategy, long max_total_routing_fee_msat, long[] dns_resolvers); // MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta); public static native long ChannelManager_create_inbound_payment(long this_arg, long min_value_msat, int invoice_expiry_delta_secs, long min_final_cltv_expiry_delta); // MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ ChannelManager_create_inbound_payment_for_hash(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry); @@ -9086,6 +9447,8 @@ public class bindings { 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 LDKDNSResolverMessageHandler ChannelManager_as_DNSResolverMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg); + public static native long ChannelManager_as_DNSResolverMessageHandler(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); @@ -9142,6 +9505,10 @@ public class bindings { public static native long ChannelManagerReadArgs_get_router(long this_ptr); // void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val); public static native void ChannelManagerReadArgs_set_router(long this_ptr, long val); + // const struct LDKMessageRouter *ChannelManagerReadArgs_get_message_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); + public static native long ChannelManagerReadArgs_get_message_router(long this_ptr); + // void ChannelManagerReadArgs_set_message_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKMessageRouter val); + public static native void ChannelManagerReadArgs_set_message_router(long this_ptr, long val); // const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); public static native long ChannelManagerReadArgs_get_logger(long this_ptr); // void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val); @@ -9150,8 +9517,8 @@ public class bindings { public static native long ChannelManagerReadArgs_get_default_config(long this_ptr); // void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val); public static native void ChannelManagerReadArgs_set_default_config(long this_ptr, long val); - // MUST_USE_RES struct LDKChannelManagerReadArgs ChannelManagerReadArgs_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKSignerProvider signer_provider, struct LDKFeeEstimator fee_estimator, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKRouter router, struct LDKLogger logger, struct LDKUserConfig default_config, struct LDKCVec_ChannelMonitorZ channel_monitors); - public static native long ChannelManagerReadArgs_new(long entropy_source, long node_signer, long signer_provider, long fee_estimator, long chain_monitor, long tx_broadcaster, long router, long logger, long default_config, long[] channel_monitors); + // MUST_USE_RES struct LDKChannelManagerReadArgs ChannelManagerReadArgs_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKSignerProvider signer_provider, struct LDKFeeEstimator fee_estimator, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKRouter router, struct LDKMessageRouter message_router, struct LDKLogger logger, struct LDKUserConfig default_config, struct LDKCVec_ChannelMonitorZ channel_monitors); + public static native long ChannelManagerReadArgs_new(long entropy_source, long node_signer, long signer_provider, long fee_estimator, long chain_monitor, long tx_broadcaster, long router, long message_router, long logger, long default_config, long[] channel_monitors); // struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg); public static native long C2Tuple_ThirtyTwoBytesChannelManagerZ_read(byte[] ser, long arg); // void DelayedPaymentBasepoint_free(struct LDKDelayedPaymentBasepoint this_obj); @@ -9508,10 +9875,6 @@ public class bindings { public static native long ChannelDetails_get_feerate_sat_per_1000_weight(long this_ptr); // void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); public static native void ChannelDetails_set_feerate_sat_per_1000_weight(long this_ptr, long val); - // uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - public static native long ChannelDetails_get_balance_msat(long this_ptr); - // void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); - public static native void ChannelDetails_set_balance_msat(long this_ptr, long val); // uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); public static native long ChannelDetails_get_outbound_capacity_msat(long this_ptr); // void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); @@ -9580,8 +9943,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_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); + // 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 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 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); @@ -9614,7 +9977,15 @@ public class bindings { public static native long ChannelShutdownState_read(byte[] ser); // void ExpandedKey_free(struct LDKExpandedKey this_obj); public static native void ExpandedKey_free(long this_obj); - // MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]); + // uint64_t ExpandedKey_hash(const struct LDKExpandedKey *NONNULL_PTR o); + public static native long ExpandedKey_hash(long o); + // uint64_t ExpandedKey_clone_ptr(LDKExpandedKey *NONNULL_PTR arg); + public static native long ExpandedKey_clone_ptr(long arg); + // struct LDKExpandedKey ExpandedKey_clone(const struct LDKExpandedKey *NONNULL_PTR orig); + public static native long ExpandedKey_clone(long orig); + // bool ExpandedKey_eq(const struct LDKExpandedKey *NONNULL_PTR a, const struct LDKExpandedKey *NONNULL_PTR b); + public static native boolean ExpandedKey_eq(long a, long b); + // MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(struct LDKThirtyTwoBytes key_material); public static native long ExpandedKey_new(byte[] key_material); // struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ create(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, const struct LDKEntropySource *NONNULL_PTR entropy_source, uint64_t current_time, struct LDKCOption_u16Z min_final_cltv_expiry_delta); public static native long create(long keys, long min_value_msat, int invoice_expiry_delta_secs, long entropy_source, long current_time, long min_final_cltv_expiry_delta); @@ -11272,6 +11643,8 @@ public class bindings { public static native long FinalOnionHopData_clone_ptr(long arg); // struct LDKFinalOnionHopData FinalOnionHopData_clone(const struct LDKFinalOnionHopData *NONNULL_PTR orig); public static native long FinalOnionHopData_clone(long orig); + // bool FinalOnionHopData_eq(const struct LDKFinalOnionHopData *NONNULL_PTR a, const struct LDKFinalOnionHopData *NONNULL_PTR b); + public static native boolean FinalOnionHopData_eq(long a, long b); // void OnionPacket_free(struct LDKOnionPacket this_obj); public static native void OnionPacket_free(long this_obj); // uint8_t OnionPacket_get_version(const struct LDKOnionPacket *NONNULL_PTR this_ptr); @@ -11552,6 +11925,8 @@ public class bindings { 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 LDKDNSResolverMessageHandler IgnoringMessageHandler_as_DNSResolverMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); + public static native long IgnoringMessageHandler_as_DNSResolverMessageHandler(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); @@ -12028,34 +12403,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); - // 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); - public static native long InitFeatures_read(byte[] ser); - // struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj); - public static native byte[] ChannelFeatures_write(long obj); - // struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser); - public static native long ChannelFeatures_read(byte[] ser); - // struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj); - public static native byte[] NodeFeatures_write(long obj); - // struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser); - public static native long NodeFeatures_read(byte[] ser); - // struct LDKCVec_u8Z Bolt11InvoiceFeatures_write(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR obj); - public static native byte[] Bolt11InvoiceFeatures_write(long obj); - // struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ Bolt11InvoiceFeatures_read(struct LDKu8slice ser); - public static native long Bolt11InvoiceFeatures_read(byte[] ser); - // struct LDKCVec_u8Z Bolt12InvoiceFeatures_write(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR obj); - public static native byte[] Bolt12InvoiceFeatures_write(long obj); - // struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ Bolt12InvoiceFeatures_read(struct LDKu8slice ser); - public static native long Bolt12InvoiceFeatures_read(byte[] ser); - // struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj); - public static native byte[] BlindedHopFeatures_write(long obj); - // struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser); - public static native long BlindedHopFeatures_read(byte[] ser); - // struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj); - 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 ShutdownScript_free(struct LDKShutdownScript this_obj); public static native void ShutdownScript_free(long this_obj); // uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg); @@ -12130,24 +12477,20 @@ public class bindings { public static native byte[] ChannelId_write(long obj); // struct LDKCResult_ChannelIdDecodeErrorZ ChannelId_read(struct LDKu8slice ser); 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_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, 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 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 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 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_payment_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, 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_with_description_hash_and_payment_hash(long channelmanager, long amt_msat, long description_hash, int invoice_expiry_delta_secs, byte[] payment_hash, long min_final_cltv_expiry_delta); + // struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_payment_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKCOption_u64Z amt_msat, struct LDKStr description, 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_with_payment_hash(long channelmanager, long amt_msat, String description, int invoice_expiry_delta_secs, byte[] payment_hash, long min_final_cltv_expiry_delta); + // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_variable_amount_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msat); + public static native long payment_parameters_from_variable_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); @@ -12180,24 +12523,6 @@ public class bindings { 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); - public static native void PaymentSendFailure_free(long this_ptr); - // uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg); - public static native long PaymentSendFailure_clone_ptr(long arg); - // struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig); - public static native long PaymentSendFailure_clone(long orig); - // struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a); - public static native long PaymentSendFailure_parameter_error(long a); - // struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a); - public static native long PaymentSendFailure_path_parameter_error(long[] a); - // struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a); - public static native long PaymentSendFailure_all_failed_resend_safe(long[] a); - // struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void); - public static native long PaymentSendFailure_duplicate_payment(); - // struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id); - 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); @@ -12222,8 +12547,10 @@ public class bindings { public static native long ProbeSendFailure_clone(long orig); // struct LDKProbeSendFailure ProbeSendFailure_route_not_found(void); public static native long ProbeSendFailure_route_not_found(); - // struct LDKProbeSendFailure ProbeSendFailure_sending_failed(struct LDKPaymentSendFailure a); - public static native long ProbeSendFailure_sending_failed(long a); + // struct LDKProbeSendFailure ProbeSendFailure_parameter_error(struct LDKAPIError a); + public static native long ProbeSendFailure_parameter_error(long a); + // struct LDKProbeSendFailure ProbeSendFailure_duplicate_probe(void); + public static native long ProbeSendFailure_duplicate_probe(); // bool ProbeSendFailure_eq(const struct LDKProbeSendFailure *NONNULL_PTR a, const struct LDKProbeSendFailure *NONNULL_PTR b); public static native boolean ProbeSendFailure_eq(long a, long b); // void RecipientOnionFields_free(struct LDKRecipientOnionFields this_obj); @@ -12262,6 +12589,34 @@ public class bindings { public static native long Type_clone(long orig); // void Type_free(struct LDKType this_ptr); public static native void Type_free(long this_ptr); + // 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); + public static native long InitFeatures_read(byte[] ser); + // struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj); + public static native byte[] ChannelFeatures_write(long obj); + // struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser); + public static native long ChannelFeatures_read(byte[] ser); + // struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj); + public static native byte[] NodeFeatures_write(long obj); + // struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser); + public static native long NodeFeatures_read(byte[] ser); + // struct LDKCVec_u8Z Bolt11InvoiceFeatures_write(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR obj); + public static native byte[] Bolt11InvoiceFeatures_write(long obj); + // struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ Bolt11InvoiceFeatures_read(struct LDKu8slice ser); + public static native long Bolt11InvoiceFeatures_read(byte[] ser); + // struct LDKCVec_u8Z Bolt12InvoiceFeatures_write(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR obj); + public static native byte[] Bolt12InvoiceFeatures_write(long obj); + // struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ Bolt12InvoiceFeatures_read(struct LDKu8slice ser); + public static native long Bolt12InvoiceFeatures_read(byte[] ser); + // struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj); + public static native byte[] BlindedHopFeatures_write(long obj); + // struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser); + public static native long BlindedHopFeatures_read(byte[] ser); + // struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj); + 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 OfferId_free(struct LDKOfferId this_obj); public static native void OfferId_free(long this_obj); // const uint8_t (*OfferId_get_a(const struct LDKOfferId *NONNULL_PTR this_ptr))[32]; @@ -12354,8 +12709,8 @@ public class bindings { 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); - // MUST_USE_RES struct LDKPublicKey Offer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg); - public static native byte[] Offer_signing_pubkey(long this_arg); + // MUST_USE_RES struct LDKPublicKey Offer_issuer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg); + public static native byte[] Offer_issuer_signing_pubkey(long this_arg); // MUST_USE_RES struct LDKOfferId Offer_id(const struct LDKOffer *NONNULL_PTR this_arg); public static native long Offer_id(long this_arg); // MUST_USE_RES bool Offer_supports_chain(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes chain); @@ -12368,12 +12723,8 @@ 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 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); + // MUST_USE_RES struct LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ Offer_request_invoice(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(long this_arg, long expanded_key, long nonce, byte[] payment_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); @@ -12450,6 +12801,8 @@ 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 struct LDKCVec_BlindedPaymentPathZ UnsignedBolt12Invoice_payment_paths(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + public static native long[] UnsignedBolt12Invoice_payment_paths(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); @@ -12482,20 +12835,24 @@ public class bindings { 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); + // MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_issuer_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + public static native byte[] UnsignedBolt12Invoice_issuer_signing_pubkey(long this_arg); // MUST_USE_RES struct LDKu8slice UnsignedBolt12Invoice_payer_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); public static native byte[] UnsignedBolt12Invoice_payer_metadata(long this_arg); // MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedBolt12Invoice_invoice_request_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); public static native long UnsignedBolt12Invoice_invoice_request_features(long this_arg); // MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); public static native long UnsignedBolt12Invoice_quantity(long this_arg); - // MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_payer_id(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); - public static native byte[] UnsignedBolt12Invoice_payer_id(long this_arg); + // MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_payer_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + public static native byte[] UnsignedBolt12Invoice_payer_signing_pubkey(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 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 LDKCVec_BlindedPaymentPathZ Bolt12Invoice_payment_paths(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + public static native long[] Bolt12Invoice_payment_paths(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); @@ -12528,14 +12885,16 @@ public class bindings { 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); + // MUST_USE_RES struct LDKPublicKey Bolt12Invoice_issuer_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + public static native byte[] Bolt12Invoice_issuer_signing_pubkey(long this_arg); // MUST_USE_RES struct LDKu8slice Bolt12Invoice_payer_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); public static native byte[] Bolt12Invoice_payer_metadata(long this_arg); // MUST_USE_RES struct LDKInvoiceRequestFeatures Bolt12Invoice_invoice_request_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); public static native long Bolt12Invoice_invoice_request_features(long this_arg); // MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); public static native long Bolt12Invoice_quantity(long this_arg); - // MUST_USE_RES struct LDKPublicKey Bolt12Invoice_payer_id(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); - public static native byte[] Bolt12Invoice_payer_id(long this_arg); + // MUST_USE_RES struct LDKPublicKey Bolt12Invoice_payer_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + public static native byte[] Bolt12Invoice_payer_signing_pubkey(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 struct LDKThirtyTwoBytes Bolt12Invoice_payment_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); @@ -12598,30 +12957,20 @@ public class bindings { public static native byte[] InvoiceError_write(long obj); // struct LDKCResult_InvoiceErrorDecodeErrorZ InvoiceError_read(struct LDKu8slice ser); public static native long InvoiceError_read(byte[] ser); - // void InvoiceRequestWithExplicitPayerIdBuilder_free(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_obj); - public static native void InvoiceRequestWithExplicitPayerIdBuilder_free(long this_obj); - // void InvoiceRequestWithDerivedPayerIdBuilder_free(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_obj); - public static native void InvoiceRequestWithDerivedPayerIdBuilder_free(long this_obj); - // MUST_USE_RES struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_build(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg); - public static native long InvoiceRequestWithExplicitPayerIdBuilder_build(long this_arg); - // MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_chain(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, enum LDKNetwork network); - public static native long InvoiceRequestWithExplicitPayerIdBuilder_chain(long this_arg, Network network); - // MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, uint64_t amount_msats); - public static native long InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(long this_arg, long amount_msats); - // MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_quantity(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, uint64_t quantity); - public static native long InvoiceRequestWithExplicitPayerIdBuilder_quantity(long this_arg, long quantity); - // MUST_USE_RES void InvoiceRequestWithExplicitPayerIdBuilder_payer_note(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, struct LDKStr payer_note); - public static native void InvoiceRequestWithExplicitPayerIdBuilder_payer_note(long this_arg, String payer_note); - // MUST_USE_RES struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg); - public static native long InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(long this_arg); - // MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_chain(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, enum LDKNetwork network); - public static native long InvoiceRequestWithDerivedPayerIdBuilder_chain(long this_arg, Network network); - // MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, uint64_t amount_msats); - public static native long InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(long this_arg, long amount_msats); - // MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_quantity(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, uint64_t quantity); - public static native long InvoiceRequestWithDerivedPayerIdBuilder_quantity(long this_arg, long quantity); - // MUST_USE_RES void InvoiceRequestWithDerivedPayerIdBuilder_payer_note(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, struct LDKStr payer_note); - public static native void InvoiceRequestWithDerivedPayerIdBuilder_payer_note(long this_arg, String payer_note); + // void InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_free(struct LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_obj); + public static native void InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_free(long this_obj); + // MUST_USE_RES struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_build_and_sign(struct LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_arg); + public static native long InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_build_and_sign(long this_arg); + // MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_chain(struct LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_arg, enum LDKNetwork network); + public static native long InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_chain(long this_arg, Network network); + // MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_amount_msats(struct LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_arg, uint64_t amount_msats); + public static native long InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_amount_msats(long this_arg, long amount_msats); + // MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_quantity(struct LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_arg, uint64_t quantity); + public static native long InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_quantity(long this_arg, long quantity); + // MUST_USE_RES void InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_payer_note(struct LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_arg, struct LDKStr payer_note); + public static native void InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_payer_note(long this_arg, String payer_note); + // MUST_USE_RES void InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_sourced_from_human_readable_name(struct LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_arg, struct LDKHumanReadableName hrn); + public static native void InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_sourced_from_human_readable_name(long this_arg, long hrn); // void UnsignedInvoiceRequest_free(struct LDKUnsignedInvoiceRequest this_obj); public static native void UnsignedInvoiceRequest_free(long this_obj); // uint64_t UnsignedInvoiceRequest_clone_ptr(LDKUnsignedInvoiceRequest *NONNULL_PTR arg); @@ -12666,22 +13015,26 @@ public class bindings { 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); - // MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_signing_pubkey(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); - public static native byte[] UnsignedInvoiceRequest_signing_pubkey(long this_arg); + // MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_issuer_signing_pubkey(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); + public static native byte[] UnsignedInvoiceRequest_issuer_signing_pubkey(long this_arg); // MUST_USE_RES struct LDKu8slice UnsignedInvoiceRequest_payer_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); public static native byte[] UnsignedInvoiceRequest_payer_metadata(long this_arg); // MUST_USE_RES struct LDKThirtyTwoBytes UnsignedInvoiceRequest_chain(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); public static native byte[] UnsignedInvoiceRequest_chain(long this_arg); // MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_amount_msats(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); public static native long UnsignedInvoiceRequest_amount_msats(long this_arg); + // MUST_USE_RES bool UnsignedInvoiceRequest_has_amount_msats(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); + public static native boolean UnsignedInvoiceRequest_has_amount_msats(long this_arg); // MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedInvoiceRequest_invoice_request_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); public static native long UnsignedInvoiceRequest_invoice_request_features(long this_arg); // MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); public static native long UnsignedInvoiceRequest_quantity(long this_arg); - // MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_payer_id(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); - public static native byte[] UnsignedInvoiceRequest_payer_id(long this_arg); + // MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_payer_signing_pubkey(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); + public static native byte[] UnsignedInvoiceRequest_payer_signing_pubkey(long this_arg); // MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_payer_note(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); public static native long UnsignedInvoiceRequest_payer_note(long this_arg); + // MUST_USE_RES struct LDKHumanReadableName UnsignedInvoiceRequest_offer_from_hrn(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); + public static native long UnsignedInvoiceRequest_offer_from_hrn(long this_arg); // MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ InvoiceRequest_chains(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); public static native byte[][] InvoiceRequest_chains(long this_arg); // MUST_USE_RES struct LDKCOption_CVec_u8ZZ InvoiceRequest_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); @@ -12700,22 +13053,26 @@ public class bindings { 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); - // MUST_USE_RES struct LDKPublicKey InvoiceRequest_signing_pubkey(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); - public static native byte[] InvoiceRequest_signing_pubkey(long this_arg); + // MUST_USE_RES struct LDKPublicKey InvoiceRequest_issuer_signing_pubkey(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); + public static native byte[] InvoiceRequest_issuer_signing_pubkey(long this_arg); // MUST_USE_RES struct LDKu8slice InvoiceRequest_payer_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); public static native byte[] InvoiceRequest_payer_metadata(long this_arg); // MUST_USE_RES struct LDKThirtyTwoBytes InvoiceRequest_chain(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); public static native byte[] InvoiceRequest_chain(long this_arg); // MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_amount_msats(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); public static native long InvoiceRequest_amount_msats(long this_arg); + // MUST_USE_RES bool InvoiceRequest_has_amount_msats(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); + public static native boolean InvoiceRequest_has_amount_msats(long this_arg); // MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequest_invoice_request_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); public static native long InvoiceRequest_invoice_request_features(long this_arg); // MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); public static native long InvoiceRequest_quantity(long this_arg); - // MUST_USE_RES struct LDKPublicKey InvoiceRequest_payer_id(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); - public static native byte[] InvoiceRequest_payer_id(long this_arg); + // MUST_USE_RES struct LDKPublicKey InvoiceRequest_payer_signing_pubkey(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); + public static native byte[] InvoiceRequest_payer_signing_pubkey(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 LDKHumanReadableName InvoiceRequest_offer_from_hrn(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); + public static native long InvoiceRequest_offer_from_hrn(long this_arg); // 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_BlindedPaymentPathZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at); @@ -12744,22 +13101,26 @@ public class bindings { 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); - // MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_signing_pubkey(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); - public static native byte[] VerifiedInvoiceRequest_signing_pubkey(long this_arg); + // MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_issuer_signing_pubkey(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); + public static native byte[] VerifiedInvoiceRequest_issuer_signing_pubkey(long this_arg); // MUST_USE_RES struct LDKu8slice VerifiedInvoiceRequest_payer_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); public static native byte[] VerifiedInvoiceRequest_payer_metadata(long this_arg); // MUST_USE_RES struct LDKThirtyTwoBytes VerifiedInvoiceRequest_chain(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); public static native byte[] VerifiedInvoiceRequest_chain(long this_arg); // MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_amount_msats(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); public static native long VerifiedInvoiceRequest_amount_msats(long this_arg); + // MUST_USE_RES bool VerifiedInvoiceRequest_has_amount_msats(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); + public static native boolean VerifiedInvoiceRequest_has_amount_msats(long this_arg); // MUST_USE_RES struct LDKInvoiceRequestFeatures VerifiedInvoiceRequest_invoice_request_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); public static native long VerifiedInvoiceRequest_invoice_request_features(long this_arg); // MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); public static native long VerifiedInvoiceRequest_quantity(long this_arg); - // MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_payer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); - public static native byte[] VerifiedInvoiceRequest_payer_id(long this_arg); + // MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_payer_signing_pubkey(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); + public static native byte[] VerifiedInvoiceRequest_payer_signing_pubkey(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 LDKHumanReadableName VerifiedInvoiceRequest_offer_from_hrn(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); + public static native long VerifiedInvoiceRequest_offer_from_hrn(long this_arg); // 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_BlindedPaymentPathZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at); @@ -12772,12 +13133,14 @@ public class bindings { public static native byte[] UnsignedInvoiceRequest_write(long obj); // struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj); public static native byte[] InvoiceRequest_write(long obj); + // struct LDKCResult_InvoiceRequestDecodeErrorZ InvoiceRequest_read(struct LDKu8slice ser); + public static native long InvoiceRequest_read(byte[] ser); // void InvoiceRequestFields_free(struct LDKInvoiceRequestFields this_obj); public static native void InvoiceRequestFields_free(long this_obj); - // struct LDKPublicKey InvoiceRequestFields_get_payer_id(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr); - public static native byte[] InvoiceRequestFields_get_payer_id(long this_ptr); - // void InvoiceRequestFields_set_payer_id(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void InvoiceRequestFields_set_payer_id(long this_ptr, byte[] val); + // struct LDKPublicKey InvoiceRequestFields_get_payer_signing_pubkey(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr); + public static native byte[] InvoiceRequestFields_get_payer_signing_pubkey(long this_ptr); + // void InvoiceRequestFields_set_payer_signing_pubkey(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKPublicKey val); + public static native void InvoiceRequestFields_set_payer_signing_pubkey(long this_ptr, byte[] val); // struct LDKCOption_u64Z InvoiceRequestFields_get_quantity(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr); public static native long InvoiceRequestFields_get_quantity(long this_ptr); // void InvoiceRequestFields_set_quantity(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); @@ -12786,8 +13149,12 @@ public class bindings { public static native long InvoiceRequestFields_get_payer_note_truncated(long this_ptr); // void InvoiceRequestFields_set_payer_note_truncated(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKUntrustedString val); public static native void InvoiceRequestFields_set_payer_note_truncated(long this_ptr, long val); - // MUST_USE_RES struct LDKInvoiceRequestFields InvoiceRequestFields_new(struct LDKPublicKey payer_id_arg, struct LDKCOption_u64Z quantity_arg, struct LDKUntrustedString payer_note_truncated_arg); - public static native long InvoiceRequestFields_new(byte[] payer_id_arg, long quantity_arg, long payer_note_truncated_arg); + // struct LDKHumanReadableName InvoiceRequestFields_get_human_readable_name(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr); + public static native long InvoiceRequestFields_get_human_readable_name(long this_ptr); + // void InvoiceRequestFields_set_human_readable_name(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKHumanReadableName val); + public static native void InvoiceRequestFields_set_human_readable_name(long this_ptr, long val); + // MUST_USE_RES struct LDKInvoiceRequestFields InvoiceRequestFields_new(struct LDKPublicKey payer_signing_pubkey_arg, struct LDKCOption_u64Z quantity_arg, struct LDKUntrustedString payer_note_truncated_arg, struct LDKHumanReadableName human_readable_name_arg); + public static native long InvoiceRequestFields_new(byte[] payer_signing_pubkey_arg, long quantity_arg, long payer_note_truncated_arg, long human_readable_name_arg); // uint64_t InvoiceRequestFields_clone_ptr(LDKInvoiceRequestFields *NONNULL_PTR arg); public static native long InvoiceRequestFields_clone_ptr(long arg); // struct LDKInvoiceRequestFields InvoiceRequestFields_clone(const struct LDKInvoiceRequestFields *NONNULL_PTR orig); @@ -12866,12 +13233,10 @@ public class bindings { public static native Bolt12SemanticError Bolt12SemanticError_unexpected_features(); // enum LDKBolt12SemanticError Bolt12SemanticError_missing_description(void); public static native Bolt12SemanticError Bolt12SemanticError_missing_description(); - // enum LDKBolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(void); - public static native Bolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(); - // enum LDKBolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(void); - public static native Bolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(); - // enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_signing_pubkey(void); - public static native Bolt12SemanticError Bolt12SemanticError_unexpected_signing_pubkey(); + // enum LDKBolt12SemanticError Bolt12SemanticError_missing_issuer_signing_pubkey(void); + public static native Bolt12SemanticError Bolt12SemanticError_missing_issuer_signing_pubkey(); + // enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_issuer_signing_pubkey(void); + public static native Bolt12SemanticError Bolt12SemanticError_unexpected_issuer_signing_pubkey(); // enum LDKBolt12SemanticError Bolt12SemanticError_missing_quantity(void); public static native Bolt12SemanticError Bolt12SemanticError_missing_quantity(); // enum LDKBolt12SemanticError Bolt12SemanticError_invalid_quantity(void); @@ -12884,8 +13249,8 @@ public class bindings { public static native Bolt12SemanticError Bolt12SemanticError_unexpected_metadata(); // enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_metadata(void); public static native Bolt12SemanticError Bolt12SemanticError_missing_payer_metadata(); - // enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_id(void); - public static native Bolt12SemanticError Bolt12SemanticError_missing_payer_id(); + // enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_signing_pubkey(void); + public static native Bolt12SemanticError Bolt12SemanticError_missing_payer_signing_pubkey(); // enum LDKBolt12SemanticError Bolt12SemanticError_duplicate_payment_id(void); public static native Bolt12SemanticError Bolt12SemanticError_duplicate_payment_id(); // enum LDKBolt12SemanticError Bolt12SemanticError_missing_paths(void); @@ -12900,18 +13265,24 @@ public class bindings { 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_signing_pubkey(void); + public static native Bolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(); + // enum LDKBolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(void); + public static native Bolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(); // enum LDKBolt12SemanticError Bolt12SemanticError_missing_signature(void); public static native Bolt12SemanticError Bolt12SemanticError_missing_signature(); + // enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_human_readable_name(void); + public static native Bolt12SemanticError Bolt12SemanticError_unexpected_human_readable_name(); // void RefundMaybeWithDerivedMetadataBuilder_free(struct LDKRefundMaybeWithDerivedMetadataBuilder this_obj); public static native void RefundMaybeWithDerivedMetadataBuilder_free(long this_obj); // uint64_t RefundMaybeWithDerivedMetadataBuilder_clone_ptr(LDKRefundMaybeWithDerivedMetadataBuilder *NONNULL_PTR arg); public static native long RefundMaybeWithDerivedMetadataBuilder_clone_ptr(long arg); // struct LDKRefundMaybeWithDerivedMetadataBuilder RefundMaybeWithDerivedMetadataBuilder_clone(const struct LDKRefundMaybeWithDerivedMetadataBuilder *NONNULL_PTR orig); 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 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 struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_new(struct LDKCVec_u8Z metadata, struct LDKPublicKey signing_pubkey, uint64_t amount_msats); + public static native long RefundMaybeWithDerivedMetadataBuilder_new(byte[] metadata, byte[] signing_pubkey, long amount_msats); + // MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_deriving_signing_pubkey(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_signing_pubkey(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); @@ -12956,8 +13327,8 @@ public class bindings { public static native long Refund_features(long this_arg); // MUST_USE_RES struct LDKCOption_u64Z Refund_quantity(const struct LDKRefund *NONNULL_PTR this_arg); public static native long Refund_quantity(long this_arg); - // MUST_USE_RES struct LDKPublicKey Refund_payer_id(const struct LDKRefund *NONNULL_PTR this_arg); - public static native byte[] Refund_payer_id(long this_arg); + // MUST_USE_RES struct LDKPublicKey Refund_payer_signing_pubkey(const struct LDKRefund *NONNULL_PTR this_arg); + public static native byte[] Refund_payer_signing_pubkey(long this_arg); // MUST_USE_RES struct LDKPrintableString Refund_payer_note(const struct LDKRefund *NONNULL_PTR this_arg); public static native long Refund_payer_note(long this_arg); // uint64_t Refund_hash(const struct LDKRefund *NONNULL_PTR o); @@ -13350,8 +13721,6 @@ public class bindings { public static native long DefaultRouter_new(long network_graph, long logger, long entropy_source, long scorer, long score_params); // struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg); public static native long DefaultRouter_as_Router(long this_arg); - // struct LDKMessageRouter DefaultRouter_as_MessageRouter(const struct LDKDefaultRouter *NONNULL_PTR this_arg); - public static native long DefaultRouter_as_MessageRouter(long this_arg); // void Router_free(struct LDKRouter this_ptr); public static native void Router_free(long this_ptr); // void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj); @@ -13836,8 +14205,10 @@ public class bindings { public static native long ProbabilisticScorer_estimated_channel_liquidity_range(long this_arg, long scid, long target); // MUST_USE_RES struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target); public static native long ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(long this_arg, long scid, long target); - // MUST_USE_RES struct LDKCOption_f64Z ProbabilisticScorer_historical_estimated_payment_success_probability(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target, uint64_t amount_msat, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR params); - public static native long ProbabilisticScorer_historical_estimated_payment_success_probability(long this_arg, long scid, long target, long amount_msat, long params); + // MUST_USE_RES struct LDKCOption_f64Z ProbabilisticScorer_historical_estimated_payment_success_probability(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target, uint64_t amount_msat, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR params, bool allow_fallback_estimation); + public static native long ProbabilisticScorer_historical_estimated_payment_success_probability(long this_arg, long scid, long target, long amount_msat, long params, boolean allow_fallback_estimation); + // MUST_USE_RES struct LDKCOption_f64Z ProbabilisticScorer_live_estimated_payment_success_probability(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target, uint64_t amount_msat, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR params); + public static native long ProbabilisticScorer_live_estimated_payment_success_probability(long this_arg, long scid, long target, long amount_msat, long params); // struct LDKScoreLookUp ProbabilisticScorer_as_ScoreLookUp(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg); public static native long ProbabilisticScorer_as_ScoreLookUp(long this_arg); // struct LDKScoreUpdate ProbabilisticScorer_as_ScoreUpdate(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg); @@ -14184,24 +14555,16 @@ public class bindings { 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); + // MUST_USE_RES struct LDKHeldHtlcAvailable HeldHtlcAvailable_new(void); + public static native long HeldHtlcAvailable_new(); // 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); + // MUST_USE_RES struct LDKReleaseHeldHtlc ReleaseHeldHtlc_new(void); + public static native long ReleaseHeldHtlc_new(); // 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); @@ -14224,6 +14587,88 @@ public class bindings { 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 DNSResolverMessageHandler_free(struct LDKDNSResolverMessageHandler this_ptr); + public static native void DNSResolverMessageHandler_free(long this_ptr); + // void DNSResolverMessage_free(struct LDKDNSResolverMessage this_ptr); + public static native void DNSResolverMessage_free(long this_ptr); + // uint64_t DNSResolverMessage_clone_ptr(LDKDNSResolverMessage *NONNULL_PTR arg); + public static native long DNSResolverMessage_clone_ptr(long arg); + // struct LDKDNSResolverMessage DNSResolverMessage_clone(const struct LDKDNSResolverMessage *NONNULL_PTR orig); + public static native long DNSResolverMessage_clone(long orig); + // struct LDKDNSResolverMessage DNSResolverMessage_dnssecquery(struct LDKDNSSECQuery a); + public static native long DNSResolverMessage_dnssecquery(long a); + // struct LDKDNSResolverMessage DNSResolverMessage_dnssecproof(struct LDKDNSSECProof a); + public static native long DNSResolverMessage_dnssecproof(long a); + // uint64_t DNSResolverMessage_hash(const struct LDKDNSResolverMessage *NONNULL_PTR o); + public static native long DNSResolverMessage_hash(long o); + // bool DNSResolverMessage_eq(const struct LDKDNSResolverMessage *NONNULL_PTR a, const struct LDKDNSResolverMessage *NONNULL_PTR b); + public static native boolean DNSResolverMessage_eq(long a, long b); + // void DNSSECQuery_free(struct LDKDNSSECQuery this_obj); + public static native void DNSSECQuery_free(long this_obj); + // uint64_t DNSSECQuery_clone_ptr(LDKDNSSECQuery *NONNULL_PTR arg); + public static native long DNSSECQuery_clone_ptr(long arg); + // struct LDKDNSSECQuery DNSSECQuery_clone(const struct LDKDNSSECQuery *NONNULL_PTR orig); + public static native long DNSSECQuery_clone(long orig); + // uint64_t DNSSECQuery_hash(const struct LDKDNSSECQuery *NONNULL_PTR o); + public static native long DNSSECQuery_hash(long o); + // bool DNSSECQuery_eq(const struct LDKDNSSECQuery *NONNULL_PTR a, const struct LDKDNSSECQuery *NONNULL_PTR b); + public static native boolean DNSSECQuery_eq(long a, long b); + // void DNSSECProof_free(struct LDKDNSSECProof this_obj); + public static native void DNSSECProof_free(long this_obj); + // struct LDKCVec_u8Z DNSSECProof_get_proof(const struct LDKDNSSECProof *NONNULL_PTR this_ptr); + public static native byte[] DNSSECProof_get_proof(long this_ptr); + // void DNSSECProof_set_proof(struct LDKDNSSECProof *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); + public static native void DNSSECProof_set_proof(long this_ptr, byte[] val); + // uint64_t DNSSECProof_clone_ptr(LDKDNSSECProof *NONNULL_PTR arg); + public static native long DNSSECProof_clone_ptr(long arg); + // struct LDKDNSSECProof DNSSECProof_clone(const struct LDKDNSSECProof *NONNULL_PTR orig); + public static native long DNSSECProof_clone(long orig); + // uint64_t DNSSECProof_hash(const struct LDKDNSSECProof *NONNULL_PTR o); + public static native long DNSSECProof_hash(long o); + // bool DNSSECProof_eq(const struct LDKDNSSECProof *NONNULL_PTR a, const struct LDKDNSSECProof *NONNULL_PTR b); + public static native boolean DNSSECProof_eq(long a, long b); + // MUST_USE_RES bool DNSResolverMessage_is_known_type(uint64_t tlv_type); + public static native boolean DNSResolverMessage_is_known_type(long tlv_type); + // struct LDKCVec_u8Z DNSResolverMessage_write(const struct LDKDNSResolverMessage *NONNULL_PTR obj); + public static native byte[] DNSResolverMessage_write(long obj); + // struct LDKCResult_DNSResolverMessageDecodeErrorZ DNSResolverMessage_read(struct LDKu8slice ser, uint64_t arg); + public static native long DNSResolverMessage_read(byte[] ser, long arg); + // struct LDKOnionMessageContents DNSResolverMessage_as_OnionMessageContents(const struct LDKDNSResolverMessage *NONNULL_PTR this_arg); + public static native long DNSResolverMessage_as_OnionMessageContents(long this_arg); + // void HumanReadableName_free(struct LDKHumanReadableName this_obj); + public static native void HumanReadableName_free(long this_obj); + // uint64_t HumanReadableName_clone_ptr(LDKHumanReadableName *NONNULL_PTR arg); + public static native long HumanReadableName_clone_ptr(long arg); + // struct LDKHumanReadableName HumanReadableName_clone(const struct LDKHumanReadableName *NONNULL_PTR orig); + public static native long HumanReadableName_clone(long orig); + // uint64_t HumanReadableName_hash(const struct LDKHumanReadableName *NONNULL_PTR o); + public static native long HumanReadableName_hash(long o); + // bool HumanReadableName_eq(const struct LDKHumanReadableName *NONNULL_PTR a, const struct LDKHumanReadableName *NONNULL_PTR b); + public static native boolean HumanReadableName_eq(long a, long b); + // MUST_USE_RES struct LDKCResult_HumanReadableNameNoneZ HumanReadableName_new(struct LDKStr user, struct LDKStr domain); + public static native long HumanReadableName_new(String user, String domain); + // MUST_USE_RES struct LDKCResult_HumanReadableNameNoneZ HumanReadableName_from_encoded(struct LDKStr encoded); + public static native long HumanReadableName_from_encoded(String encoded); + // MUST_USE_RES struct LDKStr HumanReadableName_user(const struct LDKHumanReadableName *NONNULL_PTR this_arg); + public static native String HumanReadableName_user(long this_arg); + // MUST_USE_RES struct LDKStr HumanReadableName_domain(const struct LDKHumanReadableName *NONNULL_PTR this_arg); + public static native String HumanReadableName_domain(long this_arg); + // struct LDKCVec_u8Z HumanReadableName_write(const struct LDKHumanReadableName *NONNULL_PTR obj); + public static native byte[] HumanReadableName_write(long obj); + // struct LDKCResult_HumanReadableNameDecodeErrorZ HumanReadableName_read(struct LDKu8slice ser); + public static native long HumanReadableName_read(byte[] ser); + // void OMNameResolver_free(struct LDKOMNameResolver this_obj); + public static native void OMNameResolver_free(long this_obj); + // MUST_USE_RES struct LDKOMNameResolver OMNameResolver_new(uint32_t latest_block_time, uint32_t latest_block_height); + public static native long OMNameResolver_new(int latest_block_time, int latest_block_height); + // void OMNameResolver_new_best_block(const struct LDKOMNameResolver *NONNULL_PTR this_arg, uint32_t height, uint32_t time); + public static native void OMNameResolver_new_best_block(long this_arg, int height, int time); + // MUST_USE_RES struct LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ OMNameResolver_resolve_name(const struct LDKOMNameResolver *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id, struct LDKHumanReadableName name, const struct LDKEntropySource *NONNULL_PTR entropy_source); + public static native long OMNameResolver_resolve_name(long this_arg, byte[] payment_id, long name, long entropy_source); + // MUST_USE_RES struct LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ OMNameResolver_handle_dnssec_proof_for_offer(const struct LDKOMNameResolver *NONNULL_PTR this_arg, struct LDKDNSSECProof msg, struct LDKDNSResolverContext context); + public static native long OMNameResolver_handle_dnssec_proof_for_offer(long this_arg, long msg, long context); + // MUST_USE_RES struct LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ OMNameResolver_handle_dnssec_proof_for_uri(const struct LDKOMNameResolver *NONNULL_PTR this_arg, struct LDKDNSSECProof msg, struct LDKDNSResolverContext context); + public static native long OMNameResolver_handle_dnssec_proof_for_uri(long this_arg, long msg, long context); // void OnionMessenger_free(struct LDKOnionMessenger this_obj); public static native void OnionMessenger_free(long this_obj); // void Responder_free(struct LDKResponder this_obj); @@ -14248,6 +14693,8 @@ public class bindings { 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); + // MUST_USE_RES struct LDKMessageSendInstructions ResponseInstruction_into_instructions(struct LDKResponseInstruction this_arg); + public static native long ResponseInstruction_into_instructions(long this_arg); // 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); @@ -14370,10 +14817,10 @@ public class bindings { 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 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 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 LDKDNSResolverMessageHandler dns_resolver, 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 dns_resolver, 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 LDKDNSResolverMessageHandler dns_resolver, 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 dns_resolver, 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); @@ -14446,6 +14893,8 @@ public class bindings { public static native long ParsedOnionMessageContents_clone(long orig); // struct LDKParsedOnionMessageContents ParsedOnionMessageContents_offers(struct LDKOffersMessage a); public static native long ParsedOnionMessageContents_offers(long a); + // struct LDKParsedOnionMessageContents ParsedOnionMessageContents_dnsresolver(struct LDKDNSResolverMessage a); + public static native long ParsedOnionMessageContents_dnsresolver(long a); // struct LDKParsedOnionMessageContents ParsedOnionMessageContents_custom(struct LDKOnionMessageContents a); public static native long ParsedOnionMessageContents_custom(long a); // struct LDKOnionMessageContents ParsedOnionMessageContents_as_OnionMessageContents(const struct LDKParsedOnionMessageContents *NONNULL_PTR this_arg); @@ -14632,24 +15081,34 @@ public class bindings { public static native long ForwardTlvs_clone(long orig); // void ReceiveTlvs_free(struct LDKReceiveTlvs this_obj); public static native void ReceiveTlvs_free(long this_obj); - // const uint8_t (*ReceiveTlvs_get_payment_secret(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr))[32]; - public static native byte[] ReceiveTlvs_get_payment_secret(long this_ptr); - // void ReceiveTlvs_set_payment_secret(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void ReceiveTlvs_set_payment_secret(long this_ptr, byte[] val); - // struct LDKPaymentConstraints ReceiveTlvs_get_payment_constraints(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr); - public static native long ReceiveTlvs_get_payment_constraints(long this_ptr); - // void ReceiveTlvs_set_payment_constraints(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val); - public static native void ReceiveTlvs_set_payment_constraints(long this_ptr, long val); - // struct LDKPaymentContext ReceiveTlvs_get_payment_context(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr); - public static native long ReceiveTlvs_get_payment_context(long this_ptr); - // void ReceiveTlvs_set_payment_context(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentContext val); - public static native void ReceiveTlvs_set_payment_context(long this_ptr, long val); - // MUST_USE_RES struct LDKReceiveTlvs ReceiveTlvs_new(struct LDKThirtyTwoBytes payment_secret_arg, struct LDKPaymentConstraints payment_constraints_arg, struct LDKPaymentContext payment_context_arg); - public static native long ReceiveTlvs_new(byte[] payment_secret_arg, long payment_constraints_arg, long payment_context_arg); // uint64_t ReceiveTlvs_clone_ptr(LDKReceiveTlvs *NONNULL_PTR arg); public static native long ReceiveTlvs_clone_ptr(long arg); // struct LDKReceiveTlvs ReceiveTlvs_clone(const struct LDKReceiveTlvs *NONNULL_PTR orig); public static native long ReceiveTlvs_clone(long orig); + // MUST_USE_RES struct LDKUnauthenticatedReceiveTlvs ReceiveTlvs_tlvs(const struct LDKReceiveTlvs *NONNULL_PTR this_arg); + public static native long ReceiveTlvs_tlvs(long this_arg); + // void UnauthenticatedReceiveTlvs_free(struct LDKUnauthenticatedReceiveTlvs this_obj); + public static native void UnauthenticatedReceiveTlvs_free(long this_obj); + // const uint8_t (*UnauthenticatedReceiveTlvs_get_payment_secret(const struct LDKUnauthenticatedReceiveTlvs *NONNULL_PTR this_ptr))[32]; + public static native byte[] UnauthenticatedReceiveTlvs_get_payment_secret(long this_ptr); + // void UnauthenticatedReceiveTlvs_set_payment_secret(struct LDKUnauthenticatedReceiveTlvs *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + public static native void UnauthenticatedReceiveTlvs_set_payment_secret(long this_ptr, byte[] val); + // struct LDKPaymentConstraints UnauthenticatedReceiveTlvs_get_payment_constraints(const struct LDKUnauthenticatedReceiveTlvs *NONNULL_PTR this_ptr); + public static native long UnauthenticatedReceiveTlvs_get_payment_constraints(long this_ptr); + // void UnauthenticatedReceiveTlvs_set_payment_constraints(struct LDKUnauthenticatedReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val); + public static native void UnauthenticatedReceiveTlvs_set_payment_constraints(long this_ptr, long val); + // struct LDKPaymentContext UnauthenticatedReceiveTlvs_get_payment_context(const struct LDKUnauthenticatedReceiveTlvs *NONNULL_PTR this_ptr); + public static native long UnauthenticatedReceiveTlvs_get_payment_context(long this_ptr); + // void UnauthenticatedReceiveTlvs_set_payment_context(struct LDKUnauthenticatedReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentContext val); + public static native void UnauthenticatedReceiveTlvs_set_payment_context(long this_ptr, long val); + // MUST_USE_RES struct LDKUnauthenticatedReceiveTlvs UnauthenticatedReceiveTlvs_new(struct LDKThirtyTwoBytes payment_secret_arg, struct LDKPaymentConstraints payment_constraints_arg, struct LDKPaymentContext payment_context_arg); + public static native long UnauthenticatedReceiveTlvs_new(byte[] payment_secret_arg, long payment_constraints_arg, long payment_context_arg); + // uint64_t UnauthenticatedReceiveTlvs_clone_ptr(LDKUnauthenticatedReceiveTlvs *NONNULL_PTR arg); + public static native long UnauthenticatedReceiveTlvs_clone_ptr(long arg); + // struct LDKUnauthenticatedReceiveTlvs UnauthenticatedReceiveTlvs_clone(const struct LDKUnauthenticatedReceiveTlvs *NONNULL_PTR orig); + public static native long UnauthenticatedReceiveTlvs_clone(long orig); + // MUST_USE_RES struct LDKReceiveTlvs UnauthenticatedReceiveTlvs_authenticate(struct LDKUnauthenticatedReceiveTlvs this_arg, struct LDKNonce nonce, const struct LDKExpandedKey *NONNULL_PTR expanded_key); + public static native long UnauthenticatedReceiveTlvs_authenticate(long this_arg, long nonce, long expanded_key); // void PaymentRelay_free(struct LDKPaymentRelay this_obj); public static native void PaymentRelay_free(long this_obj); // uint16_t PaymentRelay_get_cltv_expiry_delta(const struct LDKPaymentRelay *NONNULL_PTR this_ptr); @@ -14692,22 +15151,12 @@ public class bindings { public static native long PaymentContext_clone_ptr(long arg); // struct LDKPaymentContext PaymentContext_clone(const struct LDKPaymentContext *NONNULL_PTR orig); public static native long PaymentContext_clone(long orig); - // struct LDKPaymentContext PaymentContext_unknown(struct LDKUnknownPaymentContext a); - public static native long PaymentContext_unknown(long a); // struct LDKPaymentContext PaymentContext_bolt12_offer(struct LDKBolt12OfferContext a); public static native long PaymentContext_bolt12_offer(long a); // struct LDKPaymentContext PaymentContext_bolt12_refund(struct LDKBolt12RefundContext a); public static native long PaymentContext_bolt12_refund(long a); // bool PaymentContext_eq(const struct LDKPaymentContext *NONNULL_PTR a, const struct LDKPaymentContext *NONNULL_PTR b); public static native boolean PaymentContext_eq(long a, long b); - // void UnknownPaymentContext_free(struct LDKUnknownPaymentContext this_obj); - public static native void UnknownPaymentContext_free(long this_obj); - // uint64_t UnknownPaymentContext_clone_ptr(LDKUnknownPaymentContext *NONNULL_PTR arg); - public static native long UnknownPaymentContext_clone_ptr(long arg); - // struct LDKUnknownPaymentContext UnknownPaymentContext_clone(const struct LDKUnknownPaymentContext *NONNULL_PTR orig); - public static native long UnknownPaymentContext_clone(long orig); - // bool UnknownPaymentContext_eq(const struct LDKUnknownPaymentContext *NONNULL_PTR a, const struct LDKUnknownPaymentContext *NONNULL_PTR b); - public static native boolean UnknownPaymentContext_eq(long a, long b); // void Bolt12OfferContext_free(struct LDKBolt12OfferContext this_obj); public static native void Bolt12OfferContext_free(long this_obj); // struct LDKOfferId Bolt12OfferContext_get_offer_id(const struct LDKBolt12OfferContext *NONNULL_PTR this_ptr); @@ -14740,6 +15189,8 @@ public class bindings { public static native byte[] ForwardTlvs_write(long obj); // struct LDKCVec_u8Z ReceiveTlvs_write(const struct LDKReceiveTlvs *NONNULL_PTR obj); public static native byte[] ReceiveTlvs_write(long obj); + // struct LDKCVec_u8Z UnauthenticatedReceiveTlvs_write(const struct LDKUnauthenticatedReceiveTlvs *NONNULL_PTR obj); + public static native byte[] UnauthenticatedReceiveTlvs_write(long obj); // struct LDKCVec_u8Z PaymentRelay_write(const struct LDKPaymentRelay *NONNULL_PTR obj); public static native byte[] PaymentRelay_write(long obj); // struct LDKCResult_PaymentRelayDecodeErrorZ PaymentRelay_read(struct LDKu8slice ser); @@ -14752,10 +15203,6 @@ public class bindings { public static native byte[] PaymentContext_write(long obj); // struct LDKCResult_PaymentContextDecodeErrorZ PaymentContext_read(struct LDKu8slice ser); public static native long PaymentContext_read(byte[] ser); - // struct LDKCVec_u8Z UnknownPaymentContext_write(const struct LDKUnknownPaymentContext *NONNULL_PTR obj); - public static native byte[] UnknownPaymentContext_write(long obj); - // struct LDKCResult_UnknownPaymentContextDecodeErrorZ UnknownPaymentContext_read(struct LDKu8slice ser); - public static native long UnknownPaymentContext_read(byte[] ser); // struct LDKCVec_u8Z Bolt12OfferContext_write(const struct LDKBolt12OfferContext *NONNULL_PTR obj); public static native byte[] Bolt12OfferContext_write(long obj); // struct LDKCResult_Bolt12OfferContextDecodeErrorZ Bolt12OfferContext_read(struct LDKu8slice ser); @@ -14836,6 +15283,10 @@ public class bindings { 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_async_payments(struct LDKAsyncPaymentsContext a); + public static native long MessageContext_async_payments(long a); + // struct LDKMessageContext MessageContext_dnsresolver(struct LDKDNSResolverContext a); + public static native long MessageContext_dnsresolver(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); @@ -14848,10 +15299,18 @@ public class bindings { 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); + // struct LDKOffersContext OffersContext_inbound_payment(struct LDKThirtyTwoBytes payment_hash, struct LDKNonce nonce, struct LDKThirtyTwoBytes hmac); + public static native long OffersContext_inbound_payment(byte[] payment_hash, long nonce, byte[] hmac); // 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); + // void AsyncPaymentsContext_free(struct LDKAsyncPaymentsContext this_ptr); + public static native void AsyncPaymentsContext_free(long this_ptr); + // uint64_t AsyncPaymentsContext_clone_ptr(LDKAsyncPaymentsContext *NONNULL_PTR arg); + public static native long AsyncPaymentsContext_clone_ptr(long arg); + // struct LDKAsyncPaymentsContext AsyncPaymentsContext_clone(const struct LDKAsyncPaymentsContext *NONNULL_PTR orig); + public static native long AsyncPaymentsContext_clone(long orig); + // struct LDKAsyncPaymentsContext AsyncPaymentsContext_outbound_payment(struct LDKThirtyTwoBytes payment_id, struct LDKNonce nonce, struct LDKThirtyTwoBytes hmac); + public static native long AsyncPaymentsContext_outbound_payment(byte[] payment_id, long nonce, byte[] hmac); // 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); @@ -14860,6 +15319,30 @@ public class bindings { public static native byte[] OffersContext_write(long obj); // struct LDKCResult_OffersContextDecodeErrorZ OffersContext_read(struct LDKu8slice ser); public static native long OffersContext_read(byte[] ser); + // struct LDKCVec_u8Z AsyncPaymentsContext_write(const struct LDKAsyncPaymentsContext *NONNULL_PTR obj); + public static native byte[] AsyncPaymentsContext_write(long obj); + // struct LDKCResult_AsyncPaymentsContextDecodeErrorZ AsyncPaymentsContext_read(struct LDKu8slice ser); + public static native long AsyncPaymentsContext_read(byte[] ser); + // void DNSResolverContext_free(struct LDKDNSResolverContext this_obj); + public static native void DNSResolverContext_free(long this_obj); + // const uint8_t (*DNSResolverContext_get_nonce(const struct LDKDNSResolverContext *NONNULL_PTR this_ptr))[16]; + public static native byte[] DNSResolverContext_get_nonce(long this_ptr); + // void DNSResolverContext_set_nonce(struct LDKDNSResolverContext *NONNULL_PTR this_ptr, struct LDKSixteenBytes val); + public static native void DNSResolverContext_set_nonce(long this_ptr, byte[] val); + // MUST_USE_RES struct LDKDNSResolverContext DNSResolverContext_new(struct LDKSixteenBytes nonce_arg); + public static native long DNSResolverContext_new(byte[] nonce_arg); + // uint64_t DNSResolverContext_clone_ptr(LDKDNSResolverContext *NONNULL_PTR arg); + public static native long DNSResolverContext_clone_ptr(long arg); + // struct LDKDNSResolverContext DNSResolverContext_clone(const struct LDKDNSResolverContext *NONNULL_PTR orig); + public static native long DNSResolverContext_clone(long orig); + // uint64_t DNSResolverContext_hash(const struct LDKDNSResolverContext *NONNULL_PTR o); + public static native long DNSResolverContext_hash(long o); + // bool DNSResolverContext_eq(const struct LDKDNSResolverContext *NONNULL_PTR a, const struct LDKDNSResolverContext *NONNULL_PTR b); + public static native boolean DNSResolverContext_eq(long a, long b); + // struct LDKCVec_u8Z DNSResolverContext_write(const struct LDKDNSResolverContext *NONNULL_PTR obj); + public static native byte[] DNSResolverContext_write(long obj); + // struct LDKCResult_DNSResolverContextDecodeErrorZ DNSResolverContext_read(struct LDKu8slice ser); + public static native long DNSResolverContext_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); @@ -15032,12 +15515,26 @@ public class bindings { public static native PaymentFailureReason PaymentFailureReason_invoice_request_expired(); // enum LDKPaymentFailureReason PaymentFailureReason_invoice_request_rejected(void); public static native PaymentFailureReason PaymentFailureReason_invoice_request_rejected(); + // enum LDKPaymentFailureReason PaymentFailureReason_blinded_path_creation_failed(void); + public static native PaymentFailureReason PaymentFailureReason_blinded_path_creation_failed(); // 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_COption_PaymentFailureReasonZDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser); public static native long PaymentFailureReason_read(byte[] ser); + // void InboundChannelFunds_free(struct LDKInboundChannelFunds this_ptr); + public static native void InboundChannelFunds_free(long this_ptr); + // uint64_t InboundChannelFunds_clone_ptr(LDKInboundChannelFunds *NONNULL_PTR arg); + public static native long InboundChannelFunds_clone_ptr(long arg); + // struct LDKInboundChannelFunds InboundChannelFunds_clone(const struct LDKInboundChannelFunds *NONNULL_PTR orig); + public static native long InboundChannelFunds_clone(long orig); + // struct LDKInboundChannelFunds InboundChannelFunds_push_msat(uint64_t a); + public static native long InboundChannelFunds_push_msat(long a); + // struct LDKInboundChannelFunds InboundChannelFunds_dual_funded(void); + public static native long InboundChannelFunds_dual_funded(); + // bool InboundChannelFunds_eq(const struct LDKInboundChannelFunds *NONNULL_PTR a, const struct LDKInboundChannelFunds *NONNULL_PTR b); + public static native boolean InboundChannelFunds_eq(long a, long b); // void Event_free(struct LDKEvent this_ptr); public static native void Event_free(long this_ptr); // uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg); @@ -15048,10 +15545,10 @@ public class bindings { 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, 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_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, struct LDKCOption_ThirtyTwoBytesZ payment_id); + 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, long payment_id); + // 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, struct LDKCOption_ThirtyTwoBytesZ payment_id); + 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, long payment_id); // 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_received(struct LDKThirtyTwoBytes payment_id, struct LDKBolt12Invoice invoice, struct LDKCOption_OffersContextZ context, struct LDKResponder responder); @@ -15074,18 +15571,18 @@ public class bindings { public static native long Event_htlcintercepted(byte[] intercept_id, long requested_next_hop_scid, byte[] payment_hash, long inbound_amount_msat, long expected_outbound_amount_msat); // struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs, struct LDKChannelId channel_id); public static native long Event_spendable_outputs(long[] outputs, long channel_id); - // struct LDKEvent Event_payment_forwarded(struct LDKChannelId prev_channel_id, struct LDKChannelId next_channel_id, struct LDKCOption_U128Z prev_user_channel_id, struct LDKCOption_U128Z next_user_channel_id, struct LDKCOption_u64Z total_fee_earned_msat, struct LDKCOption_u64Z skimmed_fee_msat, bool claim_from_onchain_tx, struct LDKCOption_u64Z outbound_amount_forwarded_msat); - public static native long Event_payment_forwarded(long prev_channel_id, long next_channel_id, long prev_user_channel_id, long next_user_channel_id, long total_fee_earned_msat, long skimmed_fee_msat, boolean claim_from_onchain_tx, long outbound_amount_forwarded_msat); + // struct LDKEvent Event_payment_forwarded(struct LDKChannelId prev_channel_id, struct LDKChannelId next_channel_id, struct LDKCOption_U128Z prev_user_channel_id, struct LDKCOption_U128Z next_user_channel_id, struct LDKPublicKey prev_node_id, struct LDKPublicKey next_node_id, struct LDKCOption_u64Z total_fee_earned_msat, struct LDKCOption_u64Z skimmed_fee_msat, bool claim_from_onchain_tx, struct LDKCOption_u64Z outbound_amount_forwarded_msat); + public static native long Event_payment_forwarded(long prev_channel_id, long next_channel_id, long prev_user_channel_id, long next_user_channel_id, byte[] prev_node_id, byte[] next_node_id, long total_fee_earned_msat, long skimmed_fee_msat, boolean claim_from_onchain_tx, long outbound_amount_forwarded_msat); // struct LDKEvent Event_channel_pending(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKChannelId former_temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding_txo, struct LDKChannelTypeFeatures channel_type); public static native long Event_channel_pending(long channel_id, byte[] user_channel_id, long former_temporary_channel_id, byte[] counterparty_node_id, long funding_txo, long channel_type); // struct LDKEvent Event_channel_ready(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type); 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_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, struct LDKCOption_u64Z last_local_balance_msat); + 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, long last_local_balance_msat); // 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_open_channel_request(struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t funding_satoshis, struct LDKInboundChannelFunds channel_negotiation_type, 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 channel_negotiation_type, 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); @@ -15890,6 +16387,22 @@ public class bindings { 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_dual_fund_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_dual_fund_optional(long this_arg); + // void InitFeatures_set_dual_fund_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_dual_fund_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_dual_fund(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_dual_fund(long this_arg); + // void NodeFeatures_set_dual_fund_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_dual_fund_optional(long this_arg); + // void NodeFeatures_set_dual_fund_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_dual_fund_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_dual_fund(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_dual_fund(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_dual_fund(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_dual_fund(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_dual_fund(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_dual_fund(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); @@ -16028,12 +16541,28 @@ public class bindings { 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); + // void Bolt12InvoiceFeatures_set_trampoline_routing_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + public static native void Bolt12InvoiceFeatures_set_trampoline_routing_optional(long this_arg); + // void Bolt12InvoiceFeatures_set_trampoline_routing_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + public static native void Bolt12InvoiceFeatures_set_trampoline_routing_required(long this_arg); + // MUST_USE_RES bool Bolt12InvoiceFeatures_supports_trampoline_routing(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt12InvoiceFeatures_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); + // MUST_USE_RES bool Bolt12InvoiceFeatures_requires_trampoline_routing(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean Bolt12InvoiceFeatures_requires_trampoline_routing(long this_arg); + // void NodeFeatures_set_dns_resolution_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_dns_resolution_optional(long this_arg); + // void NodeFeatures_set_dns_resolution_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_dns_resolution_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_dns_resolution(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_dns_resolution(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_dns_resolution(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_dns_resolution(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); @@ -16142,6 +16671,8 @@ public class bindings { public static native String FilesystemStore_get_data_dir(long this_arg); // struct LDKKVStore FilesystemStore_as_KVStore(const struct LDKFilesystemStore *NONNULL_PTR this_arg); public static native long FilesystemStore_as_KVStore(long this_arg); + // struct LDKMigratableKVStore FilesystemStore_as_MigratableKVStore(const struct LDKFilesystemStore *NONNULL_PTR this_arg); + public static native long FilesystemStore_as_MigratableKVStore(long this_arg); // void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj); public static native void BackgroundProcessor_free(long this_obj); // void GossipSync_free(struct LDKGossipSync this_ptr); @@ -16158,50 +16689,14 @@ public class bindings { public static native long BackgroundProcessor_join(long this_arg); // MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg); public static native long BackgroundProcessor_stop(long this_arg); - // void Bolt11ParseError_free(struct LDKBolt11ParseError this_ptr); - public static native void Bolt11ParseError_free(long this_ptr); + // void Bolt11ParseError_free(struct LDKBolt11ParseError this_obj); + public static native void Bolt11ParseError_free(long this_obj); + // bool Bolt11ParseError_eq(const struct LDKBolt11ParseError *NONNULL_PTR a, const struct LDKBolt11ParseError *NONNULL_PTR b); + public static native boolean Bolt11ParseError_eq(long a, long b); // uint64_t Bolt11ParseError_clone_ptr(LDKBolt11ParseError *NONNULL_PTR arg); public static native long Bolt11ParseError_clone_ptr(long arg); // struct LDKBolt11ParseError Bolt11ParseError_clone(const struct LDKBolt11ParseError *NONNULL_PTR orig); public static native long Bolt11ParseError_clone(long orig); - // struct LDKBolt11ParseError Bolt11ParseError_bech32_error(struct LDKBech32Error a); - public static native long Bolt11ParseError_bech32_error(long a); - // struct LDKBolt11ParseError Bolt11ParseError_parse_amount_error(struct LDKError a); - public static native long Bolt11ParseError_parse_amount_error(int a); - // struct LDKBolt11ParseError Bolt11ParseError_malformed_signature(enum LDKSecp256k1Error a); - public static native long Bolt11ParseError_malformed_signature(Secp256k1Error a); - // struct LDKBolt11ParseError Bolt11ParseError_bad_prefix(void); - public static native long Bolt11ParseError_bad_prefix(); - // struct LDKBolt11ParseError Bolt11ParseError_unknown_currency(void); - public static native long Bolt11ParseError_unknown_currency(); - // struct LDKBolt11ParseError Bolt11ParseError_unknown_si_prefix(void); - public static native long Bolt11ParseError_unknown_si_prefix(); - // struct LDKBolt11ParseError Bolt11ParseError_malformed_hrp(void); - public static native long Bolt11ParseError_malformed_hrp(); - // struct LDKBolt11ParseError Bolt11ParseError_too_short_data_part(void); - public static native long Bolt11ParseError_too_short_data_part(); - // struct LDKBolt11ParseError Bolt11ParseError_unexpected_end_of_tagged_fields(void); - public static native long Bolt11ParseError_unexpected_end_of_tagged_fields(); - // struct LDKBolt11ParseError Bolt11ParseError_description_decode_error(struct LDKError a); - public static native long Bolt11ParseError_description_decode_error(int a); - // struct LDKBolt11ParseError Bolt11ParseError_padding_error(void); - public static native long Bolt11ParseError_padding_error(); - // struct LDKBolt11ParseError Bolt11ParseError_integer_overflow_error(void); - public static native long Bolt11ParseError_integer_overflow_error(); - // struct LDKBolt11ParseError Bolt11ParseError_invalid_seg_wit_program_length(void); - public static native long Bolt11ParseError_invalid_seg_wit_program_length(); - // struct LDKBolt11ParseError Bolt11ParseError_invalid_pub_key_hash_length(void); - public static native long Bolt11ParseError_invalid_pub_key_hash_length(); - // struct LDKBolt11ParseError Bolt11ParseError_invalid_script_hash_length(void); - public static native long Bolt11ParseError_invalid_script_hash_length(); - // struct LDKBolt11ParseError Bolt11ParseError_invalid_recovery_id(void); - public static native long Bolt11ParseError_invalid_recovery_id(); - // struct LDKBolt11ParseError Bolt11ParseError_invalid_slice_length(struct LDKStr a); - public static native long Bolt11ParseError_invalid_slice_length(String a); - // struct LDKBolt11ParseError Bolt11ParseError_skip(void); - public static native long Bolt11ParseError_skip(); - // bool Bolt11ParseError_eq(const struct LDKBolt11ParseError *NONNULL_PTR a, const struct LDKBolt11ParseError *NONNULL_PTR b); - public static native boolean Bolt11ParseError_eq(long a, long b); // void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr); public static native void ParseOrSemanticError_free(long this_ptr); // uint64_t ParseOrSemanticError_clone_ptr(LDKParseOrSemanticError *NONNULL_PTR arg); @@ -16224,6 +16719,20 @@ public class bindings { public static native long Bolt11Invoice_clone(long orig); // uint64_t Bolt11Invoice_hash(const struct LDKBolt11Invoice *NONNULL_PTR o); public static native long Bolt11Invoice_hash(long o); + // void Bolt11InvoiceDescription_free(struct LDKBolt11InvoiceDescription this_ptr); + public static native void Bolt11InvoiceDescription_free(long this_ptr); + // uint64_t Bolt11InvoiceDescription_clone_ptr(LDKBolt11InvoiceDescription *NONNULL_PTR arg); + public static native long Bolt11InvoiceDescription_clone_ptr(long arg); + // struct LDKBolt11InvoiceDescription Bolt11InvoiceDescription_clone(const struct LDKBolt11InvoiceDescription *NONNULL_PTR orig); + public static native long Bolt11InvoiceDescription_clone(long orig); + // struct LDKBolt11InvoiceDescription Bolt11InvoiceDescription_direct(struct LDKDescription a); + public static native long Bolt11InvoiceDescription_direct(long a); + // struct LDKBolt11InvoiceDescription Bolt11InvoiceDescription_hash(struct LDKSha256 a); + public static native long Bolt11InvoiceDescription_hash(long a); + // bool Bolt11InvoiceDescription_eq(const struct LDKBolt11InvoiceDescription *NONNULL_PTR a, const struct LDKBolt11InvoiceDescription *NONNULL_PTR b); + public static native boolean Bolt11InvoiceDescription_eq(long a, long b); + // struct LDKStr Bolt11InvoiceDescription_to_str(const struct LDKBolt11InvoiceDescription *NONNULL_PTR o); + public static native String Bolt11InvoiceDescription_to_str(long o); // void SignedRawBolt11Invoice_free(struct LDKSignedRawBolt11Invoice this_obj); public static native void SignedRawBolt11Invoice_free(long this_obj); // bool SignedRawBolt11Invoice_eq(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR a, const struct LDKSignedRawBolt11Invoice *NONNULL_PTR b); @@ -16512,6 +17021,8 @@ public class bindings { public static native long Bolt11Invoice_amount_milli_satoshis(long this_arg); // MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description); public static native long Description_new(String description); + // MUST_USE_RES struct LDKDescription Description_empty(void); + public static native long Description_empty(); // 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); diff --git a/src/main/java/org/ldk/structs/APIError.java b/src/main/java/org/ldk/structs/APIError.java index d330283f..2e53da0a 100644 --- a/src/main/java/org/ldk/structs/APIError.java +++ b/src/main/java/org/ldk/structs/APIError.java @@ -129,7 +129,7 @@ public class APIError extends CommonBase { * a channel or cooperatively close one with this peer (and will have to force-close instead). * * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey - * [`InitFeatures`]: crate::ln::features::InitFeatures + * [`InitFeatures`]: crate::types::features::InitFeatures */ public final static class IncompatibleShutdownScript extends APIError { /** diff --git a/src/main/java/org/ldk/structs/AcceptChannelV2.java b/src/main/java/org/ldk/structs/AcceptChannelV2.java index a29a788e..1dc185ab 100644 --- a/src/main/java/org/ldk/structs/AcceptChannelV2.java +++ b/src/main/java/org/ldk/structs/AcceptChannelV2.java @@ -9,9 +9,11 @@ import javax.annotation.Nullable; /** - * An accept_channel2 message to be sent by or received from the channel accepter. + * An [`accept_channel2`] message to be sent by or received from the channel accepter. * * Used in V2 channel establishment + * + * [`accept_channel2`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel2-message */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class AcceptChannelV2 extends CommonBase { diff --git a/src/main/java/org/ldk/structs/Amount.java b/src/main/java/org/ldk/structs/Amount.java index 00231645..54ba7bae 100644 --- a/src/main/java/org/ldk/structs/Amount.java +++ b/src/main/java/org/ldk/structs/Amount.java @@ -45,7 +45,7 @@ public class Amount extends CommonBase { } } /** - * An amount of currency specified using ISO 4712. + * An amount of currency specified using ISO 4217. */ public final static class Currency extends Amount { /** diff --git a/src/main/java/org/ldk/structs/AsyncPaymentsContext.java b/src/main/java/org/ldk/structs/AsyncPaymentsContext.java new file mode 100644 index 00000000..f8d3ec2f --- /dev/null +++ b/src/main/java/org/ldk/structs/AsyncPaymentsContext.java @@ -0,0 +1,125 @@ +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 [`AsyncPaymentsMessage`]. + * + * [`AsyncPaymentsMessage`]: crate::onion_message::async_payments::AsyncPaymentsMessage + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class AsyncPaymentsContext extends CommonBase { + private AsyncPaymentsContext(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.AsyncPaymentsContext_free(ptr); } + } + static AsyncPaymentsContext constr_from_ptr(long ptr) { + bindings.LDKAsyncPaymentsContext raw_val = bindings.LDKAsyncPaymentsContext_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKAsyncPaymentsContext.OutboundPayment.class) { + return new OutboundPayment(ptr, (bindings.LDKAsyncPaymentsContext.OutboundPayment)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * Context contained within the reply [`BlindedMessagePath`] we put in outbound + * [`HeldHtlcAvailable`] messages, provided back to us in corresponding [`ReleaseHeldHtlc`] + * messages. + * + * [`HeldHtlcAvailable`]: crate::onion_message::async_payments::HeldHtlcAvailable + * [`ReleaseHeldHtlc`]: crate::onion_message::async_payments::ReleaseHeldHtlc + */ + public final static class OutboundPayment extends AsyncPaymentsContext { + /** + * ID used when payment to the originating [`Offer`] was initiated. Useful for us to identify + * which of our pending outbound payments should be released to its often-offline payee. + * + * [`Offer`]: crate::offers::offer::Offer + */ + public final byte[] payment_id; + /** + * A nonce used for authenticating that a [`ReleaseHeldHtlc`] message is valid for a preceding + * [`HeldHtlcAvailable`] message. + * + * [`ReleaseHeldHtlc`]: crate::onion_message::async_payments::ReleaseHeldHtlc + * [`HeldHtlcAvailable`]: crate::onion_message::async_payments::HeldHtlcAvailable + */ + public final org.ldk.structs.Nonce nonce; + /** + * Authentication code for the [`PaymentId`]. + * + * Prevents the recipient from being able to deanonymize us by creating a blinded path to us + * containing the expected [`PaymentId`]. + */ + public final byte[] hmac; + private OutboundPayment(long ptr, bindings.LDKAsyncPaymentsContext.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; + } + } + long clone_ptr() { + long ret = bindings.AsyncPaymentsContext_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the AsyncPaymentsContext + */ + public AsyncPaymentsContext clone() { + long ret = bindings.AsyncPaymentsContext_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.AsyncPaymentsContext ret_hu_conv = org.ldk.structs.AsyncPaymentsContext.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 OutboundPayment-variant AsyncPaymentsContext + */ + public static AsyncPaymentsContext outbound_payment(byte[] payment_id, org.ldk.structs.Nonce nonce, byte[] hmac) { + long ret = bindings.AsyncPaymentsContext_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.AsyncPaymentsContext ret_hu_conv = org.ldk.structs.AsyncPaymentsContext.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Serialize the AsyncPaymentsContext object into a byte array which can be read by AsyncPaymentsContext_read + */ + public byte[] write() { + byte[] ret = bindings.AsyncPaymentsContext_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a AsyncPaymentsContext from a byte array, created by AsyncPaymentsContext_write + */ + public static Result_AsyncPaymentsContextDecodeErrorZ read(byte[] ser) { + long ret = bindings.AsyncPaymentsContext_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_AsyncPaymentsContextDecodeErrorZ ret_hu_conv = Result_AsyncPaymentsContextDecodeErrorZ.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 index d7d04338..b0d413fe 100644 --- a/src/main/java/org/ldk/structs/AsyncPaymentsMessageHandler.java +++ b/src/main/java/org/ldk/structs/AsyncPaymentsMessageHandler.java @@ -45,12 +45,12 @@ public class AsyncPaymentsMessageHandler extends CommonBase { * * 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); + Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ handle_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); + void handle_release_held_htlc(ReleaseHeldHtlc message, AsyncPaymentsContext context); /** * Release any [`AsyncPaymentsMessage`]s that need to be sent. * @@ -63,20 +63,22 @@ public class AsyncPaymentsMessageHandler extends CommonBase { 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) { + @Override public long handle_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); + Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ ret = arg.handle_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) { + @Override public void handle_release_held_htlc(long message, long context) { 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); + org.ldk.structs.AsyncPaymentsContext context_hu_conv = org.ldk.structs.AsyncPaymentsContext.constr_from_ptr(context); + if (context_hu_conv != null) { context_hu_conv.ptrs_to.add(this); }; + arg.handle_release_held_htlc(message_hu_conv, context_hu_conv); Reference.reachabilityFence(arg); } @Override public long[] release_pending_messages() { @@ -94,8 +96,8 @@ public class AsyncPaymentsMessageHandler extends CommonBase { * * 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); + public Option_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ handle_held_htlc_available(org.ldk.structs.HeldHtlcAvailable message, @Nullable org.ldk.structs.Responder responder) { + long ret = bindings.AsyncPaymentsMessageHandler_handle_held_htlc_available(this.ptr, message.ptr, responder == null ? 0 : responder.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(message); Reference.reachabilityFence(responder); @@ -109,10 +111,11 @@ public class AsyncPaymentsMessageHandler extends CommonBase { * 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); + public void handle_release_held_htlc(org.ldk.structs.ReleaseHeldHtlc message, org.ldk.structs.AsyncPaymentsContext context) { + bindings.AsyncPaymentsMessageHandler_handle_release_held_htlc(this.ptr, message.ptr, context.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(message); + Reference.reachabilityFence(context); } /** diff --git a/src/main/java/org/ldk/structs/Bolt11InvoiceDescription.java b/src/main/java/org/ldk/structs/Bolt11InvoiceDescription.java new file mode 100644 index 00000000..7a53324e --- /dev/null +++ b/src/main/java/org/ldk/structs/Bolt11InvoiceDescription.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; + + +/** + * Represents the description of an invoice which has to be either a directly included string or + * a hash of a description provided out of band. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Bolt11InvoiceDescription extends CommonBase { + private Bolt11InvoiceDescription(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.Bolt11InvoiceDescription_free(ptr); } + } + static Bolt11InvoiceDescription constr_from_ptr(long ptr) { + bindings.LDKBolt11InvoiceDescription raw_val = bindings.LDKBolt11InvoiceDescription_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKBolt11InvoiceDescription.Direct.class) { + return new Direct(ptr, (bindings.LDKBolt11InvoiceDescription.Direct)raw_val); + } + if (raw_val.getClass() == bindings.LDKBolt11InvoiceDescription.Hash.class) { + return new Hash(ptr, (bindings.LDKBolt11InvoiceDescription.Hash)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * Description of what the invoice is for + */ + public final static class Direct extends Bolt11InvoiceDescription { + public final org.ldk.structs.Description direct; + private Direct(long ptr, bindings.LDKBolt11InvoiceDescription.Direct obj) { + super(null, ptr); + long direct = obj.direct; + org.ldk.structs.Description direct_hu_conv = null; if (direct < 0 || direct > 4096) { direct_hu_conv = new org.ldk.structs.Description(null, direct); } + if (direct_hu_conv != null) { direct_hu_conv.ptrs_to.add(this); }; + this.direct = direct_hu_conv; + } + } + /** + * Hash of the description of what the invoice is for + */ + public final static class Hash extends Bolt11InvoiceDescription { + public final org.ldk.structs.Sha256 hash; + private Hash(long ptr, bindings.LDKBolt11InvoiceDescription.Hash obj) { + super(null, ptr); + long hash = obj.hash; + org.ldk.structs.Sha256 hash_hu_conv = null; if (hash < 0 || hash > 4096) { hash_hu_conv = new org.ldk.structs.Sha256(null, hash); } + if (hash_hu_conv != null) { hash_hu_conv.ptrs_to.add(this); }; + this.hash = hash_hu_conv; + } + } + long clone_ptr() { + long ret = bindings.Bolt11InvoiceDescription_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the Bolt11InvoiceDescription + */ + public Bolt11InvoiceDescription clone() { + long ret = bindings.Bolt11InvoiceDescription_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11InvoiceDescription ret_hu_conv = org.ldk.structs.Bolt11InvoiceDescription.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 Direct-variant Bolt11InvoiceDescription + */ + public static Bolt11InvoiceDescription direct(org.ldk.structs.Description a) { + long ret = bindings.Bolt11InvoiceDescription_direct(a.ptr); + Reference.reachabilityFence(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11InvoiceDescription ret_hu_conv = org.ldk.structs.Bolt11InvoiceDescription.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 Hash-variant Bolt11InvoiceDescription + */ + public static Bolt11InvoiceDescription hash(org.ldk.structs.Sha256 a) { + long ret = bindings.Bolt11InvoiceDescription_hash(a.ptr); + Reference.reachabilityFence(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11InvoiceDescription ret_hu_conv = org.ldk.structs.Bolt11InvoiceDescription.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 Bolt11InvoiceDescriptions contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public boolean eq(org.ldk.structs.Bolt11InvoiceDescription b) { + boolean ret = bindings.Bolt11InvoiceDescription_eq(this.ptr, b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof Bolt11InvoiceDescription)) return false; + return this.eq((Bolt11InvoiceDescription)o); + } + /** + * Get the string representation of a Bolt11InvoiceDescription object + */ + public String to_str() { + String ret = bindings.Bolt11InvoiceDescription_to_str(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + +} diff --git a/src/main/java/org/ldk/structs/Bolt11InvoiceParameters.java b/src/main/java/org/ldk/structs/Bolt11InvoiceParameters.java new file mode 100644 index 00000000..3524dd0c --- /dev/null +++ b/src/main/java/org/ldk/structs/Bolt11InvoiceParameters.java @@ -0,0 +1,185 @@ +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; + + +/** + * Parameters used with [`create_bolt11_invoice`]. + * + * [`create_bolt11_invoice`]: ChannelManager::create_bolt11_invoice + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Bolt11InvoiceParameters extends CommonBase { + Bolt11InvoiceParameters(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.Bolt11InvoiceParameters_free(ptr); } + } + + /** + * The amount for the invoice, if any. + */ + public Option_u64Z get_amount_msats() { + long ret = bindings.Bolt11InvoiceParameters_get_amount_msats(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 amount for the invoice, if any. + */ + public void set_amount_msats(org.ldk.structs.Option_u64Z val) { + bindings.Bolt11InvoiceParameters_set_amount_msats(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The description for what the invoice is for, or hash of such description. + */ + public Bolt11InvoiceDescription get_description() { + long ret = bindings.Bolt11InvoiceParameters_get_description(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11InvoiceDescription ret_hu_conv = org.ldk.structs.Bolt11InvoiceDescription.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * The description for what the invoice is for, or hash of such description. + */ + public void set_description(org.ldk.structs.Bolt11InvoiceDescription val) { + bindings.Bolt11InvoiceParameters_set_description(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The invoice expiration relative to its creation time. If not set, the invoice will expire in + * [`DEFAULT_EXPIRY_TIME`] by default. + * + * The creation time used is the duration since the Unix epoch for `std` builds. For non-`std` + * builds, the highest block timestamp seen is used instead. In the latter case, use a long + * enough expiry to account for the average block time. + */ + public Option_u32Z get_invoice_expiry_delta_secs() { + long ret = bindings.Bolt11InvoiceParameters_get_invoice_expiry_delta_secs(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * The invoice expiration relative to its creation time. If not set, the invoice will expire in + * [`DEFAULT_EXPIRY_TIME`] by default. + * + * The creation time used is the duration since the Unix epoch for `std` builds. For non-`std` + * builds, the highest block timestamp seen is used instead. In the latter case, use a long + * enough expiry to account for the average block time. + */ + public void set_invoice_expiry_delta_secs(org.ldk.structs.Option_u32Z val) { + bindings.Bolt11InvoiceParameters_set_invoice_expiry_delta_secs(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The minimum `cltv_expiry` for the last HTLC in the route. If not set, will use + * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. + * + * If set, must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`], and a three-block buffer will be + * added as well to allow for up to a few new block confirmations during routing. + */ + public Option_u16Z get_min_final_cltv_expiry_delta() { + long ret = bindings.Bolt11InvoiceParameters_get_min_final_cltv_expiry_delta(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u16Z ret_hu_conv = org.ldk.structs.Option_u16Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * The minimum `cltv_expiry` for the last HTLC in the route. If not set, will use + * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. + * + * If set, must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`], and a three-block buffer will be + * added as well to allow for up to a few new block confirmations during routing. + */ + public void set_min_final_cltv_expiry_delta(org.ldk.structs.Option_u16Z val) { + bindings.Bolt11InvoiceParameters_set_min_final_cltv_expiry_delta(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The payment hash used in the invoice. If not set, a payment hash will be generated using a + * preimage that can be reproduced by [`ChannelManager`] without storing any state. + * + * Uses the payment hash if set. 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 Option_ThirtyTwoBytesZ get_payment_hash() { + long ret = bindings.Bolt11InvoiceParameters_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 used in the invoice. If not set, a payment hash will be generated using a + * preimage that can be reproduced by [`ChannelManager`] without storing any state. + * + * Uses the payment hash if set. 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 void set_payment_hash(org.ldk.structs.Option_ThirtyTwoBytesZ val) { + bindings.Bolt11InvoiceParameters_set_payment_hash(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Constructs a new Bolt11InvoiceParameters given each field + */ + public static Bolt11InvoiceParameters of(org.ldk.structs.Option_u64Z amount_msats_arg, org.ldk.structs.Bolt11InvoiceDescription description_arg, org.ldk.structs.Option_u32Z invoice_expiry_delta_secs_arg, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta_arg, org.ldk.structs.Option_ThirtyTwoBytesZ payment_hash_arg) { + long ret = bindings.Bolt11InvoiceParameters_new(amount_msats_arg.ptr, description_arg.ptr, invoice_expiry_delta_secs_arg.ptr, min_final_cltv_expiry_delta_arg.ptr, payment_hash_arg.ptr); + Reference.reachabilityFence(amount_msats_arg); + Reference.reachabilityFence(description_arg); + Reference.reachabilityFence(invoice_expiry_delta_secs_arg); + Reference.reachabilityFence(min_final_cltv_expiry_delta_arg); + Reference.reachabilityFence(payment_hash_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11InvoiceParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt11InvoiceParameters(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Creates a "default" Bolt11InvoiceParameters. See struct and individual field documentaiton for details on which values are used. + */ + public static Bolt11InvoiceParameters with_default() { + long ret = bindings.Bolt11InvoiceParameters_default(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt11InvoiceParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt11InvoiceParameters(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/Bolt11ParseError.java b/src/main/java/org/ldk/structs/Bolt11ParseError.java index f7266c64..713f30c4 100644 --- a/src/main/java/org/ldk/structs/Bolt11ParseError.java +++ b/src/main/java/org/ldk/structs/Bolt11ParseError.java @@ -14,181 +14,29 @@ import javax.annotation.Nullable; */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Bolt11ParseError extends CommonBase { - private Bolt11ParseError(Object _dummy, long ptr) { super(ptr); } + Bolt11ParseError(Object _dummy, long ptr) { super(ptr); } @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { super.finalize(); if (ptr != 0) { bindings.Bolt11ParseError_free(ptr); } } - static Bolt11ParseError constr_from_ptr(long ptr) { - bindings.LDKBolt11ParseError raw_val = bindings.LDKBolt11ParseError_ref_from_ptr(ptr); - if (raw_val.getClass() == bindings.LDKBolt11ParseError.Bech32Error.class) { - return new Bech32Error(ptr, (bindings.LDKBolt11ParseError.Bech32Error)raw_val); - } - if (raw_val.getClass() == bindings.LDKBolt11ParseError.ParseAmountError.class) { - return new ParseAmountError(ptr, (bindings.LDKBolt11ParseError.ParseAmountError)raw_val); - } - if (raw_val.getClass() == bindings.LDKBolt11ParseError.MalformedSignature.class) { - return new MalformedSignature(ptr, (bindings.LDKBolt11ParseError.MalformedSignature)raw_val); - } - if (raw_val.getClass() == bindings.LDKBolt11ParseError.BadPrefix.class) { - return new BadPrefix(ptr, (bindings.LDKBolt11ParseError.BadPrefix)raw_val); - } - if (raw_val.getClass() == bindings.LDKBolt11ParseError.UnknownCurrency.class) { - return new UnknownCurrency(ptr, (bindings.LDKBolt11ParseError.UnknownCurrency)raw_val); - } - if (raw_val.getClass() == bindings.LDKBolt11ParseError.UnknownSiPrefix.class) { - return new UnknownSiPrefix(ptr, (bindings.LDKBolt11ParseError.UnknownSiPrefix)raw_val); - } - if (raw_val.getClass() == bindings.LDKBolt11ParseError.MalformedHRP.class) { - return new MalformedHRP(ptr, (bindings.LDKBolt11ParseError.MalformedHRP)raw_val); - } - if (raw_val.getClass() == bindings.LDKBolt11ParseError.TooShortDataPart.class) { - return new TooShortDataPart(ptr, (bindings.LDKBolt11ParseError.TooShortDataPart)raw_val); - } - if (raw_val.getClass() == bindings.LDKBolt11ParseError.UnexpectedEndOfTaggedFields.class) { - return new UnexpectedEndOfTaggedFields(ptr, (bindings.LDKBolt11ParseError.UnexpectedEndOfTaggedFields)raw_val); - } - if (raw_val.getClass() == bindings.LDKBolt11ParseError.DescriptionDecodeError.class) { - return new DescriptionDecodeError(ptr, (bindings.LDKBolt11ParseError.DescriptionDecodeError)raw_val); - } - if (raw_val.getClass() == bindings.LDKBolt11ParseError.PaddingError.class) { - return new PaddingError(ptr, (bindings.LDKBolt11ParseError.PaddingError)raw_val); - } - if (raw_val.getClass() == bindings.LDKBolt11ParseError.IntegerOverflowError.class) { - return new IntegerOverflowError(ptr, (bindings.LDKBolt11ParseError.IntegerOverflowError)raw_val); - } - if (raw_val.getClass() == bindings.LDKBolt11ParseError.InvalidSegWitProgramLength.class) { - return new InvalidSegWitProgramLength(ptr, (bindings.LDKBolt11ParseError.InvalidSegWitProgramLength)raw_val); - } - if (raw_val.getClass() == bindings.LDKBolt11ParseError.InvalidPubKeyHashLength.class) { - return new InvalidPubKeyHashLength(ptr, (bindings.LDKBolt11ParseError.InvalidPubKeyHashLength)raw_val); - } - if (raw_val.getClass() == bindings.LDKBolt11ParseError.InvalidScriptHashLength.class) { - return new InvalidScriptHashLength(ptr, (bindings.LDKBolt11ParseError.InvalidScriptHashLength)raw_val); - } - if (raw_val.getClass() == bindings.LDKBolt11ParseError.InvalidRecoveryId.class) { - return new InvalidRecoveryId(ptr, (bindings.LDKBolt11ParseError.InvalidRecoveryId)raw_val); - } - if (raw_val.getClass() == bindings.LDKBolt11ParseError.InvalidSliceLength.class) { - return new InvalidSliceLength(ptr, (bindings.LDKBolt11ParseError.InvalidSliceLength)raw_val); - } - if (raw_val.getClass() == bindings.LDKBolt11ParseError.Skip.class) { - return new Skip(ptr, (bindings.LDKBolt11ParseError.Skip)raw_val); - } - assert false; return null; // Unreachable without extending the (internal) bindings interface - } - public final static class Bech32Error extends Bolt11ParseError { - public final org.ldk.structs.Bech32Error bech32_error; - private Bech32Error(long ptr, bindings.LDKBolt11ParseError.Bech32Error obj) { - super(null, ptr); - long bech32_error = obj.bech32_error; - org.ldk.structs.Bech32Error bech32_error_hu_conv = org.ldk.structs.Bech32Error.constr_from_ptr(bech32_error); - if (bech32_error_hu_conv != null) { bech32_error_hu_conv.ptrs_to.add(this); }; - this.bech32_error = bech32_error_hu_conv; - } - } - public final static class ParseAmountError extends Bolt11ParseError { - public final org.ldk.util.UnqualifiedError parse_amount_error; - private ParseAmountError(long ptr, bindings.LDKBolt11ParseError.ParseAmountError obj) { - super(null, ptr); - int parse_amount_error = obj.parse_amount_error; - UnqualifiedError parse_amount_error_conv = new UnqualifiedError(parse_amount_error); - this.parse_amount_error = parse_amount_error_conv; - } - } - public final static class MalformedSignature extends Bolt11ParseError { - public final org.ldk.enums.Secp256k1Error malformed_signature; - private MalformedSignature(long ptr, bindings.LDKBolt11ParseError.MalformedSignature obj) { - super(null, ptr); - this.malformed_signature = obj.malformed_signature; - } - } - public final static class BadPrefix extends Bolt11ParseError { - private BadPrefix(long ptr, bindings.LDKBolt11ParseError.BadPrefix obj) { - super(null, ptr); - } - } - public final static class UnknownCurrency extends Bolt11ParseError { - private UnknownCurrency(long ptr, bindings.LDKBolt11ParseError.UnknownCurrency obj) { - super(null, ptr); - } - } - public final static class UnknownSiPrefix extends Bolt11ParseError { - private UnknownSiPrefix(long ptr, bindings.LDKBolt11ParseError.UnknownSiPrefix obj) { - super(null, ptr); - } - } - public final static class MalformedHRP extends Bolt11ParseError { - private MalformedHRP(long ptr, bindings.LDKBolt11ParseError.MalformedHRP obj) { - super(null, ptr); - } - } - public final static class TooShortDataPart extends Bolt11ParseError { - private TooShortDataPart(long ptr, bindings.LDKBolt11ParseError.TooShortDataPart obj) { - super(null, ptr); - } - } - public final static class UnexpectedEndOfTaggedFields extends Bolt11ParseError { - private UnexpectedEndOfTaggedFields(long ptr, bindings.LDKBolt11ParseError.UnexpectedEndOfTaggedFields obj) { - super(null, ptr); - } - } - public final static class DescriptionDecodeError extends Bolt11ParseError { - public final org.ldk.util.UnqualifiedError description_decode_error; - private DescriptionDecodeError(long ptr, bindings.LDKBolt11ParseError.DescriptionDecodeError obj) { - super(null, ptr); - int description_decode_error = obj.description_decode_error; - UnqualifiedError description_decode_error_conv = new UnqualifiedError(description_decode_error); - this.description_decode_error = description_decode_error_conv; - } - } - public final static class PaddingError extends Bolt11ParseError { - private PaddingError(long ptr, bindings.LDKBolt11ParseError.PaddingError obj) { - super(null, ptr); - } - } - public final static class IntegerOverflowError extends Bolt11ParseError { - private IntegerOverflowError(long ptr, bindings.LDKBolt11ParseError.IntegerOverflowError obj) { - super(null, ptr); - } - } - public final static class InvalidSegWitProgramLength extends Bolt11ParseError { - private InvalidSegWitProgramLength(long ptr, bindings.LDKBolt11ParseError.InvalidSegWitProgramLength obj) { - super(null, ptr); - } - } - public final static class InvalidPubKeyHashLength extends Bolt11ParseError { - private InvalidPubKeyHashLength(long ptr, bindings.LDKBolt11ParseError.InvalidPubKeyHashLength obj) { - super(null, ptr); - } - } - public final static class InvalidScriptHashLength extends Bolt11ParseError { - private InvalidScriptHashLength(long ptr, bindings.LDKBolt11ParseError.InvalidScriptHashLength obj) { - super(null, ptr); - } - } - public final static class InvalidRecoveryId extends Bolt11ParseError { - private InvalidRecoveryId(long ptr, bindings.LDKBolt11ParseError.InvalidRecoveryId obj) { - super(null, ptr); - } - } - public final static class InvalidSliceLength extends Bolt11ParseError { - public final java.lang.String invalid_slice_length; - private InvalidSliceLength(long ptr, bindings.LDKBolt11ParseError.InvalidSliceLength obj) { - super(null, ptr); - this.invalid_slice_length = obj.invalid_slice_length; - } - } /** - * Not an error, but used internally to signal that a part of the invoice should be ignored - * according to BOLT11 + * Checks if two Bolt11ParseErrors 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 final static class Skip extends Bolt11ParseError { - private Skip(long ptr, bindings.LDKBolt11ParseError.Skip obj) { - super(null, ptr); - } + public boolean eq(org.ldk.structs.Bolt11ParseError b) { + boolean ret = bindings.Bolt11ParseError_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 Bolt11ParseError)) return false; + return this.eq((Bolt11ParseError)o); } long clone_ptr() { long ret = bindings.Bolt11ParseError_clone_ptr(this.ptr); @@ -203,229 +51,11 @@ public class Bolt11ParseError extends CommonBase { long ret = bindings.Bolt11ParseError_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Bolt11ParseError ret_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(ret); + org.ldk.structs.Bolt11ParseError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt11ParseError(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } - /** - * Utility method to constructs a new Bech32Error-variant Bolt11ParseError - */ - public static Bolt11ParseError bech32_error(org.ldk.structs.Bech32Error a) { - long ret = bindings.Bolt11ParseError_bech32_error(a.ptr); - Reference.reachabilityFence(a); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new ParseAmountError-variant Bolt11ParseError - */ - public static Bolt11ParseError parse_amount_error(org.ldk.util.UnqualifiedError a) { - long ret = bindings.Bolt11ParseError_parse_amount_error(0); - Reference.reachabilityFence(a); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new MalformedSignature-variant Bolt11ParseError - */ - public static Bolt11ParseError malformed_signature(org.ldk.enums.Secp256k1Error a) { - long ret = bindings.Bolt11ParseError_malformed_signature(a); - Reference.reachabilityFence(a); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new BadPrefix-variant Bolt11ParseError - */ - public static Bolt11ParseError bad_prefix() { - long ret = bindings.Bolt11ParseError_bad_prefix(); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new UnknownCurrency-variant Bolt11ParseError - */ - public static Bolt11ParseError unknown_currency() { - long ret = bindings.Bolt11ParseError_unknown_currency(); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new UnknownSiPrefix-variant Bolt11ParseError - */ - public static Bolt11ParseError unknown_si_prefix() { - long ret = bindings.Bolt11ParseError_unknown_si_prefix(); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new MalformedHRP-variant Bolt11ParseError - */ - public static Bolt11ParseError malformed_hrp() { - long ret = bindings.Bolt11ParseError_malformed_hrp(); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new TooShortDataPart-variant Bolt11ParseError - */ - public static Bolt11ParseError too_short_data_part() { - long ret = bindings.Bolt11ParseError_too_short_data_part(); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant Bolt11ParseError - */ - public static Bolt11ParseError unexpected_end_of_tagged_fields() { - long ret = bindings.Bolt11ParseError_unexpected_end_of_tagged_fields(); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new DescriptionDecodeError-variant Bolt11ParseError - */ - public static Bolt11ParseError description_decode_error(org.ldk.util.UnqualifiedError a) { - long ret = bindings.Bolt11ParseError_description_decode_error(0); - Reference.reachabilityFence(a); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new PaddingError-variant Bolt11ParseError - */ - public static Bolt11ParseError padding_error() { - long ret = bindings.Bolt11ParseError_padding_error(); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new IntegerOverflowError-variant Bolt11ParseError - */ - public static Bolt11ParseError integer_overflow_error() { - long ret = bindings.Bolt11ParseError_integer_overflow_error(); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new InvalidSegWitProgramLength-variant Bolt11ParseError - */ - public static Bolt11ParseError invalid_seg_wit_program_length() { - long ret = bindings.Bolt11ParseError_invalid_seg_wit_program_length(); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new InvalidPubKeyHashLength-variant Bolt11ParseError - */ - public static Bolt11ParseError invalid_pub_key_hash_length() { - long ret = bindings.Bolt11ParseError_invalid_pub_key_hash_length(); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new InvalidScriptHashLength-variant Bolt11ParseError - */ - public static Bolt11ParseError invalid_script_hash_length() { - long ret = bindings.Bolt11ParseError_invalid_script_hash_length(); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new InvalidRecoveryId-variant Bolt11ParseError - */ - public static Bolt11ParseError invalid_recovery_id() { - long ret = bindings.Bolt11ParseError_invalid_recovery_id(); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new InvalidSliceLength-variant Bolt11ParseError - */ - public static Bolt11ParseError invalid_slice_length(java.lang.String a) { - long ret = bindings.Bolt11ParseError_invalid_slice_length(a); - Reference.reachabilityFence(a); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new Skip-variant Bolt11ParseError - */ - public static Bolt11ParseError skip() { - long ret = bindings.Bolt11ParseError_skip(); - 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); }; - return ret_hu_conv; - } - - /** - * Checks if two Bolt11ParseErrors contain equal inner contents. - * This ignores pointers and is_owned flags and looks at the values in fields. - */ - public boolean eq(org.ldk.structs.Bolt11ParseError b) { - boolean ret = bindings.Bolt11ParseError_eq(this.ptr, b.ptr); - Reference.reachabilityFence(this); - Reference.reachabilityFence(b); - return ret; - } - - @Override public boolean equals(Object o) { - if (!(o instanceof Bolt11ParseError)) return false; - return this.eq((Bolt11ParseError)o); - } /** * Get the string representation of a Bolt11ParseError object */ diff --git a/src/main/java/org/ldk/structs/Bolt12Invoice.java b/src/main/java/org/ldk/structs/Bolt12Invoice.java index c2843288..aeeae145 100644 --- a/src/main/java/org/ldk/structs/Bolt12Invoice.java +++ b/src/main/java/org/ldk/structs/Bolt12Invoice.java @@ -45,6 +45,28 @@ public class Bolt12Invoice extends CommonBase { return ret_hu_conv; } + /** + * Paths to the recipient originating from publicly reachable nodes, including information + * needed for routing payments across them. + * + * Blinded paths provide recipient privacy by obfuscating its node id. Note, however, that this + * privacy is lost if a public node id is used for + * [`Bolt12Invoice::signing_pubkey`]. + */ + public BlindedPaymentPath[] payment_paths() { + long[] ret = bindings.Bolt12Invoice_payment_paths(this.ptr); + Reference.reachabilityFence(this); + int ret_conv_20_len = ret.length; + BlindedPaymentPath[] ret_conv_20_arr = new BlindedPaymentPath[ret_conv_20_len]; + for (int u = 0; u < ret_conv_20_len; u++) { + long ret_conv_20 = ret[u]; + org.ldk.structs.BlindedPaymentPath ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.BlindedPaymentPath(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_20_arr; + } + /** * Duration since the Unix epoch when the invoice was created. */ @@ -97,7 +119,19 @@ public class Bolt12Invoice extends CommonBase { } /** - * The public key corresponding to the key used to sign the invoice. + * A typically transient public key corresponding to the key used to sign the invoice. + * + * If the invoices was created in response to an [`Offer`], then this will be: + * - [`Offer::issuer_signing_pubkey`] if it's `Some`, otherwise + * - the final blinded node id from a [`BlindedMessagePath`] in [`Offer::paths`] if `None`. + * + * If the invoice was created in response to a [`Refund`], then it is a valid pubkey chosen by + * the recipient. + * + * [`Offer`]: crate::offers::offer::Offer + * [`Offer::issuer_signing_pubkey`]: crate::offers::offer::Offer::issuer_signing_pubkey + * [`Offer::paths`]: crate::offers::offer::Offer::paths + * [`Refund`]: crate::offers::refund::Refund */ public byte[] signing_pubkey() { byte[] ret = bindings.Bolt12Invoice_signing_pubkey(this.ptr); @@ -285,6 +319,23 @@ public class Bolt12Invoice extends CommonBase { return ret_hu_conv; } + /** + * The public key used by the recipient to sign invoices. + * + * From [`Offer::issuer_signing_pubkey`] and may be `None`; also `None` if the invoice was + * created in response to a [`Refund`]. + * + * [`Offer::issuer_signing_pubkey`]: crate::offers::offer::Offer::issuer_signing_pubkey + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable + public byte[] issuer_signing_pubkey() { + byte[] ret = bindings.Bolt12Invoice_issuer_signing_pubkey(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * An unpredictable series of bytes from the payer. * @@ -330,8 +381,8 @@ public class Bolt12Invoice extends CommonBase { * * [`message_paths`]: Self::message_paths */ - public byte[] payer_id() { - byte[] ret = bindings.Bolt12Invoice_payer_id(this.ptr); + public byte[] payer_signing_pubkey() { + byte[] ret = bindings.Bolt12Invoice_payer_signing_pubkey(this.ptr); Reference.reachabilityFence(this); return ret; } diff --git a/src/main/java/org/ldk/structs/Bolt12InvoiceFeatures.java b/src/main/java/org/ldk/structs/Bolt12InvoiceFeatures.java index 1d2a5597..2a02c34d 100644 --- a/src/main/java/org/ldk/structs/Bolt12InvoiceFeatures.java +++ b/src/main/java/org/ldk/structs/Bolt12InvoiceFeatures.java @@ -264,4 +264,38 @@ public class Bolt12InvoiceFeatures extends CommonBase { return ret; } + /** + * Set this feature as optional. + */ + public void set_trampoline_routing_optional() { + bindings.Bolt12InvoiceFeatures_set_trampoline_routing_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_trampoline_routing_required() { + bindings.Bolt12InvoiceFeatures_set_trampoline_routing_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_trampoline_routing() { + boolean ret = bindings.Bolt12InvoiceFeatures_supports_trampoline_routing(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_trampoline_routing() { + boolean ret = bindings.Bolt12InvoiceFeatures_requires_trampoline_routing(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + } diff --git a/src/main/java/org/ldk/structs/ChannelDetails.java b/src/main/java/org/ldk/structs/ChannelDetails.java index f6d60c03..e4ff7f62 100644 --- a/src/main/java/org/ldk/structs/ChannelDetails.java +++ b/src/main/java/org/ldk/structs/ChannelDetails.java @@ -373,50 +373,12 @@ public class ChannelDetails extends CommonBase { Reference.reachabilityFence(val); } - /** - * Our total balance. This is the amount we would get if we close the channel. - * This value is not exact. Due to various in-flight changes and feerate changes, exactly this - * amount is not likely to be recoverable on close. - * - * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose - * balance is not available for inclusion in new outbound HTLCs). This further does not include - * any pending outgoing HTLCs which are awaiting some other resolution to be sent. - * This does not consider any on-chain fees. - * - * See also [`ChannelDetails::outbound_capacity_msat`] - */ - public long get_balance_msat() { - long ret = bindings.ChannelDetails_get_balance_msat(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Our total balance. This is the amount we would get if we close the channel. - * This value is not exact. Due to various in-flight changes and feerate changes, exactly this - * amount is not likely to be recoverable on close. - * - * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose - * balance is not available for inclusion in new outbound HTLCs). This further does not include - * any pending outgoing HTLCs which are awaiting some other resolution to be sent. - * This does not consider any on-chain fees. - * - * See also [`ChannelDetails::outbound_capacity_msat`] - */ - public void set_balance_msat(long val) { - bindings.ChannelDetails_set_balance_msat(this.ptr, val); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - /** * The available outbound capacity for sending HTLCs to the remote peer. This does not include * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not * available for inclusion in new outbound HTLCs). This further does not include any pending * outgoing HTLCs which are awaiting some other resolution to be sent. * - * See also [`ChannelDetails::balance_msat`] - * * This value is not exact. Due to various in-flight changes, feerate changes, and our * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we * should be able to spend nearly this amount. @@ -433,8 +395,6 @@ public class ChannelDetails extends CommonBase { * available for inclusion in new outbound HTLCs). This further does not include any pending * outgoing HTLCs which are awaiting some other resolution to be sent. * - * See also [`ChannelDetails::balance_msat`] - * * This value is not exact. Due to various in-flight changes, feerate changes, and our * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we * should be able to spend nearly this amount. @@ -451,8 +411,8 @@ public class ChannelDetails extends CommonBase { * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us * to use a limit as close as possible to the HTLC limit we can currently send. * - * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`], - * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`]. + * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`] and + * [`ChannelDetails::outbound_capacity_msat`]. */ public long get_next_outbound_htlc_limit_msat() { long ret = bindings.ChannelDetails_get_next_outbound_htlc_limit_msat(this.ptr); @@ -466,8 +426,8 @@ public class ChannelDetails extends CommonBase { * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us * to use a limit as close as possible to the HTLC limit we can currently send. * - * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`], - * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`]. + * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`] and + * [`ChannelDetails::outbound_capacity_msat`]. */ public void set_next_outbound_htlc_limit_msat(long val) { bindings.ChannelDetails_set_next_outbound_htlc_limit_msat(this.ptr, val); @@ -888,8 +848,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_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); + 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 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, 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); @@ -901,7 +861,6 @@ public class ChannelDetails extends CommonBase { Reference.reachabilityFence(unspendable_punishment_reserve_arg); Reference.reachabilityFence(user_channel_id_arg); Reference.reachabilityFence(feerate_sat_per_1000_weight_arg); - Reference.reachabilityFence(balance_msat_arg); Reference.reachabilityFence(outbound_capacity_msat_arg); Reference.reachabilityFence(next_outbound_htlc_limit_msat_arg); Reference.reachabilityFence(next_outbound_htlc_minimum_msat_arg); diff --git a/src/main/java/org/ldk/structs/ChannelId.java b/src/main/java/org/ldk/structs/ChannelId.java index 1d52d620..20539ed8 100644 --- a/src/main/java/org/ldk/structs/ChannelId.java +++ b/src/main/java/org/ldk/structs/ChannelId.java @@ -220,13 +220,4 @@ public class ChannelId extends CommonBase { return ret_hu_conv; } - /** - * Get the string representation of a ChannelId object - */ - public String to_str() { - String ret = bindings.ChannelId_to_str(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - } diff --git a/src/main/java/org/ldk/structs/ChannelManager.java b/src/main/java/org/ldk/structs/ChannelManager.java index 85751dff..c51fad15 100644 --- a/src/main/java/org/ldk/structs/ChannelManager.java +++ b/src/main/java/org/ldk/structs/ChannelManager.java @@ -23,6 +23,7 @@ import javax.annotation.Nullable; * - [`FeeEstimator`] to determine transaction fee rates needed to have a transaction mined in a * timely manner * - [`Router`] for finding payment paths when initiating and retrying payments + * - [`MessageRouter`] for finding message paths when initiating and retrying onion messages * - [`Logger`] for logging operational information of varying degrees * * Additionally, it implements the following traits: @@ -82,7 +83,8 @@ import javax.annotation.Nullable; * # fee_estimator: &dyn lightning::chain::chaininterface::FeeEstimator, * # chain_monitor: &dyn lightning::chain::Watch, * # tx_broadcaster: &dyn lightning::chain::chaininterface::BroadcasterInterface, - * # router: &lightning::routing::router::DefaultRouter<&NetworkGraph<&'a L>, &'a L, &ES, &S, SP, SL>, + * # router: &lightning::routing::router::DefaultRouter<&NetworkGraph<&'a L>, &'a L, &ES, &S>, + * # message_router: &lightning::onion_message::messenger::DefaultMessageRouter<&NetworkGraph<&'a L>, &'a L, &ES>, * # logger: &L, * # entropy_source: &ES, * # node_signer: &dyn lightning::sign::NodeSigner, @@ -98,18 +100,18 @@ import javax.annotation.Nullable; * }; * let default_config = UserConfig::default(); * let channel_manager = ChannelManager::new( - * fee_estimator, chain_monitor, tx_broadcaster, router, logger, entropy_source, node_signer, - * signer_provider, default_config, params, current_timestamp + * fee_estimator, chain_monitor, tx_broadcaster, router, message_router, logger, + * entropy_source, node_signer, signer_provider, default_config, params, current_timestamp, * ); * * Restart from deserialized data * let mut channel_monitors = read_channel_monitors(); * let args = ChannelManagerReadArgs::new( * entropy_source, node_signer, signer_provider, fee_estimator, chain_monitor, tx_broadcaster, - * router, logger, default_config, channel_monitors.iter_mut().collect() + * router, message_router, logger, default_config, channel_monitors.iter().collect(), * ); * let (block_hash, channel_manager) = - * <(BlockHash, ChannelManager<_, _, _, _, _, _, _, _>)>::read(&mut reader, args)?; + * <(BlockHash, ChannelManager<_, _, _, _, _, _, _, _, _>)>::read(&mut reader, args)?; * * Update the ChannelManager and ChannelMonitors with the latest chain data * ... @@ -334,12 +336,12 @@ import javax.annotation.Nullable; * * ## BOLT 11 Invoices * - * The [`lightning-invoice`] crate is useful for creating BOLT 11 invoices. Specifically, use the - * functions in its `utils` module for constructing invoices that are compatible with - * [`ChannelManager`]. These functions serve as a convenience for building invoices with the + * The [`lightning-invoice`] crate is useful for creating BOLT 11 invoices. However, in order to + * construct a [`Bolt11Invoice`] that is compatible with [`ChannelManager`], use + * [`create_bolt11_invoice`]. This method serves as a convenience for building invoices with the * [`PaymentHash`] and [`PaymentSecret`] returned from [`create_inbound_payment`]. To provide your - * own [`PaymentHash`], use [`create_inbound_payment_for_hash`] or the corresponding functions in - * the [`lightning-invoice`] `utils` module. + * own [`PaymentHash`], override the appropriate [`Bolt11InvoiceParameters`], which is equivalent + * to using [`create_inbound_payment_for_hash`]. * * [`ChannelManager`] generates an [`Event::PaymentClaimable`] once the full payment has been * received. Call [`claim_funds`] to release the [`PaymentPreimage`], which in turn will result in @@ -347,19 +349,21 @@ import javax.annotation.Nullable; * * ``` * # use lightning::events::{Event, EventsProvider, PaymentPurpose}; - * # use lightning::ln::channelmanager::AChannelManager; + * # use lightning::ln::channelmanager::{AChannelManager, Bolt11InvoiceParameters}; * # * # fn example(channel_manager: T) { * # let channel_manager = channel_manager.get_cm(); - * Or use utils::create_invoice_from_channelmanager - * let known_payment_hash = match channel_manager.create_inbound_payment( - * Some(10_000_000), 3600, None - * ) { - * Ok((payment_hash, _payment_secret)) => { - * println!(\"Creating inbound payment {}\", payment_hash); - * payment_hash + * let params = Bolt11InvoiceParameters { + * amount_msats: Some(10_000_000), + * invoice_expiry_delta_secs: Some(3600), + * ..Default::default() + * }; + * let invoice = match channel_manager.create_bolt11_invoice(params) { + * Ok(invoice) => { + * println!(\"Creating invoice with payment hash {}\", invoice.payment_hash()); + * invoice * }, - * Err(()) => panic!(\"Error creating inbound payment\"), + * Err(e) => panic!(\"Error creating invoice: {}\", e), * }; * * On the event processing thread @@ -367,7 +371,7 @@ import javax.annotation.Nullable; * match event { * Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose { * PaymentPurpose::Bolt11InvoicePayment { payment_preimage: Some(payment_preimage), .. } => { - * assert_eq!(payment_hash, known_payment_hash); + * assert_eq!(payment_hash.0, invoice.payment_hash().as_ref()); * println!(\"Claiming payment {}\", payment_hash); * channel_manager.claim_funds(payment_preimage); * }, @@ -375,7 +379,7 @@ import javax.annotation.Nullable; * println!(\"Unknown payment hash: {}\", payment_hash); * }, * PaymentPurpose::SpontaneousPayment(payment_preimage) => { - * assert_ne!(payment_hash, known_payment_hash); + * assert_ne!(payment_hash.0, invoice.payment_hash().as_ref()); * println!(\"Claiming spontaneous payment {}\", payment_hash); * channel_manager.claim_funds(payment_preimage); * }, @@ -383,7 +387,7 @@ import javax.annotation.Nullable; * # _ => {}, * }, * Event::PaymentClaimed { payment_hash, amount_msat, .. } => { - * assert_eq!(payment_hash, known_payment_hash); + * assert_eq!(payment_hash.0, invoice.payment_hash().as_ref()); * println!(\"Claimed {} msats\", amount_msat); * }, * ... @@ -394,13 +398,14 @@ import javax.annotation.Nullable; * # } * ``` * - * For paying an invoice, [`lightning-invoice`] provides a `payment` module with convenience - * functions for use with [`send_payment`]. + * For paying an invoice, see the [`bolt11_payment`] module with convenience functions for use with + * [`send_payment`]. * * ``` * # use lightning::events::{Event, EventsProvider}; - * # use lightning::ln::types::PaymentHash; - * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, RecipientOnionFields, Retry}; + * # use lightning::types::payment::PaymentHash; + * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails}; + * # use lightning::ln::outbound_payment::{RecipientOnionFields, Retry}; * # use lightning::routing::router::RouteParameters; * # * # fn example( @@ -503,7 +508,8 @@ import javax.annotation.Nullable; * * ``` * # use lightning::events::{Event, EventsProvider}; - * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, Retry}; + * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails}; + * # use lightning::ln::outbound_payment::Retry; * # use lightning::offers::offer::Offer; * # * # fn example( @@ -559,7 +565,8 @@ import javax.annotation.Nullable; * ``` * # use core::time::Duration; * # use lightning::events::{Event, EventsProvider}; - * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, Retry}; + * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails}; + * # use lightning::ln::outbound_payment::Retry; * # use lightning::offers::parse::Bolt12SemanticError; * # * # fn example( @@ -729,8 +736,10 @@ import javax.annotation.Nullable; * [`list_recent_payments`]: Self::list_recent_payments * [`abandon_payment`]: Self::abandon_payment * [`lightning-invoice`]: https://docs.rs/lightning_invoice/latest/lightning_invoice + * [`create_bolt11_invoice`]: Self::create_bolt11_invoice * [`create_inbound_payment`]: Self::create_inbound_payment * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash + * [`bolt11_payment`]: crate::ln::bolt11_payment * [`claim_funds`]: Self::claim_funds * [`send_payment`]: Self::send_payment * [`offers`]: crate::offers @@ -775,12 +784,13 @@ public class ChannelManager extends CommonBase { * [`block_disconnected`]: chain::Listen::block_disconnected * [`params.best_block.block_hash`]: chain::BestBlock::block_hash */ - public static ChannelManager of(org.ldk.structs.FeeEstimator fee_est, org.ldk.structs.Watch chain_monitor, org.ldk.structs.BroadcasterInterface tx_broadcaster, org.ldk.structs.Router router, org.ldk.structs.Logger logger, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.SignerProvider signer_provider, org.ldk.structs.UserConfig config, org.ldk.structs.ChainParameters params, int current_timestamp) { - long ret = bindings.ChannelManager_new(fee_est.ptr, chain_monitor.ptr, tx_broadcaster.ptr, router.ptr, logger.ptr, entropy_source.ptr, node_signer.ptr, signer_provider.ptr, config.ptr, params.ptr, current_timestamp); + public static ChannelManager of(org.ldk.structs.FeeEstimator fee_est, org.ldk.structs.Watch chain_monitor, org.ldk.structs.BroadcasterInterface tx_broadcaster, org.ldk.structs.Router router, org.ldk.structs.MessageRouter message_router, org.ldk.structs.Logger logger, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.SignerProvider signer_provider, org.ldk.structs.UserConfig config, org.ldk.structs.ChainParameters params, int current_timestamp) { + long ret = bindings.ChannelManager_new(fee_est.ptr, chain_monitor.ptr, tx_broadcaster.ptr, router.ptr, message_router.ptr, logger.ptr, entropy_source.ptr, node_signer.ptr, signer_provider.ptr, config.ptr, params.ptr, current_timestamp); Reference.reachabilityFence(fee_est); Reference.reachabilityFence(chain_monitor); Reference.reachabilityFence(tx_broadcaster); Reference.reachabilityFence(router); + Reference.reachabilityFence(message_router); Reference.reachabilityFence(logger); Reference.reachabilityFence(entropy_source); Reference.reachabilityFence(node_signer); @@ -795,6 +805,7 @@ public class ChannelManager extends CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(chain_monitor); }; 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(message_router); }; 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(node_signer); }; @@ -1102,14 +1113,8 @@ public class ChannelManager extends CommonBase { } /** - * 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. + * Sends a payment to the route found using the provided [`RouteParameters`], retrying failed + * payment paths based on the provided `Retry`. * * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via * [`PeerManager::process_events`]). @@ -1117,9 +1122,9 @@ public class ChannelManager extends CommonBase { * # Avoiding Duplicate Payments * * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this - * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment - * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an - * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a + * method will error with [`RetryableSendFailure::DuplicatePayment`]. Note, however, that once a + * payment is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of + * an [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a * second payment with the same [`PaymentId`]. * * Thus, in order to ensure duplicate payments are not sent, you should implement your own @@ -1133,57 +1138,58 @@ public class ChannelManager extends CommonBase { * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See * [`ChannelManager::list_recent_payments`] for more information. * - * # Possible Error States on [`PaymentSendFailure`] - * - * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with - * each entry matching the corresponding-index entry in the route paths, see - * [`PaymentSendFailure`] for more info. - * - * In general, a path may raise: - * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee, - * node public key) is specified. - * [`APIError::ChannelUnavailable`] if the next-hop channel is not available as it has been - * closed, doesn't exist, or the peer is currently disconnected. - * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the - * relevant updates. + * Routes are automatically found using the [`Router] provided on startup. To fix a route for a + * particular payment, match the [`PaymentId`] passed to [`Router::find_route_with_id`]. * - * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been - * irrevocably committed to on our end. In such a case, do NOT retry the payment with a - * different route unless you intend to pay twice! - * - * [`RouteHop`]: crate::routing::router::RouteHop * [`Event::PaymentSent`]: events::Event::PaymentSent * [`Event::PaymentFailed`]: events::Event::PaymentFailed * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress */ - public Result_NonePaymentSendFailureZ send_payment_with_route(org.ldk.structs.Route route, byte[] payment_hash, org.ldk.structs.RecipientOnionFields recipient_onion, byte[] payment_id) { - long ret = bindings.ChannelManager_send_payment_with_route(this.ptr, route.ptr, InternalUtils.check_arr_len(payment_hash, 32), recipient_onion.ptr, InternalUtils.check_arr_len(payment_id, 32)); + public Result_NoneRetryableSendFailureZ send_payment(byte[] payment_hash, org.ldk.structs.RecipientOnionFields recipient_onion, byte[] payment_id, org.ldk.structs.RouteParameters route_params, org.ldk.structs.Retry retry_strategy) { + long ret = bindings.ChannelManager_send_payment(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), recipient_onion.ptr, InternalUtils.check_arr_len(payment_id, 32), route_params.ptr, retry_strategy.ptr); Reference.reachabilityFence(this); - Reference.reachabilityFence(route); Reference.reachabilityFence(payment_hash); Reference.reachabilityFence(recipient_onion); Reference.reachabilityFence(payment_id); + Reference.reachabilityFence(route_params); + Reference.reachabilityFence(retry_strategy); if (ret >= 0 && ret <= 4096) { return null; } - Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); + Result_NoneRetryableSendFailureZ ret_hu_conv = Result_NoneRetryableSendFailureZ.constr_from_ptr(ret); return ret_hu_conv; } /** - * Similar to [`ChannelManager::send_payment_with_route`], but will automatically find a route based on - * `route_params` and retry failed payment paths based on `retry_strategy`. + * Pays the [`Bolt12Invoice`] associated with the `payment_id` encoded in its `payer_metadata`. + * + * The invoice's `payer_metadata` is used to authenticate that the invoice was indeed requested + * before attempting a payment. [`Bolt12PaymentError::UnexpectedInvoice`] is returned if this + * fails or if the encoded `payment_id` is not recognized. The latter may happen once the + * payment is no longer tracked because the payment was attempted after: + * - an invoice for the `payment_id` was already paid, + * - one full [timer tick] has elapsed since initially requesting the invoice when paying an + * offer, or + * - the refund corresponding to the invoice has already expired. + * + * To retry the payment, request another invoice using a new `payment_id`. + * + * Attempting to pay the same invoice twice while the first payment is still pending will + * result in a [`Bolt12PaymentError::DuplicateInvoice`]. + * + * Otherwise, either [`Event::PaymentSent`] or [`Event::PaymentFailed`] are used to indicate + * whether or not the payment was successful. + * + * [timer tick]: Self::timer_tick_occurred */ - public Result_NoneRetryableSendFailureZ send_payment(byte[] payment_hash, org.ldk.structs.RecipientOnionFields recipient_onion, byte[] payment_id, org.ldk.structs.RouteParameters route_params, org.ldk.structs.Retry retry_strategy) { - long ret = bindings.ChannelManager_send_payment(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), recipient_onion.ptr, InternalUtils.check_arr_len(payment_id, 32), route_params.ptr, retry_strategy.ptr); + public Result_NoneBolt12PaymentErrorZ send_payment_for_bolt12_invoice(org.ldk.structs.Bolt12Invoice invoice, org.ldk.structs.Option_OffersContextZ context) { + long ret = bindings.ChannelManager_send_payment_for_bolt12_invoice(this.ptr, invoice.ptr, context.ptr); Reference.reachabilityFence(this); - Reference.reachabilityFence(payment_hash); - Reference.reachabilityFence(recipient_onion); - Reference.reachabilityFence(payment_id); - Reference.reachabilityFence(route_params); - Reference.reachabilityFence(retry_strategy); + Reference.reachabilityFence(invoice); + Reference.reachabilityFence(context); if (ret >= 0 && ret <= 4096) { return null; } - Result_NoneRetryableSendFailureZ ret_hu_conv = Result_NoneRetryableSendFailureZ.constr_from_ptr(ret); + Result_NoneBolt12PaymentErrorZ ret_hu_conv = Result_NoneBolt12PaymentErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.add(invoice); }; return ret_hu_conv; } @@ -1227,38 +1233,20 @@ public class ChannelManager extends CommonBase { * would be able to guess -- otherwise, an intermediate node may claim the payment and it will * never reach the recipient. * - * See [`send_payment`] documentation for more details on the return value of this function - * and idempotency guarantees provided by the [`PaymentId`] key. - * * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See * [`send_payment`] for more information about the risks of duplicate preimage usage. * - * [`send_payment`]: Self::send_payment - */ - public Result_ThirtyTwoBytesPaymentSendFailureZ send_spontaneous_payment(org.ldk.structs.Route route, org.ldk.structs.Option_ThirtyTwoBytesZ payment_preimage, org.ldk.structs.RecipientOnionFields recipient_onion, byte[] payment_id) { - long ret = bindings.ChannelManager_send_spontaneous_payment(this.ptr, route.ptr, payment_preimage.ptr, recipient_onion.ptr, InternalUtils.check_arr_len(payment_id, 32)); - Reference.reachabilityFence(this); - Reference.reachabilityFence(route); - Reference.reachabilityFence(payment_preimage); - Reference.reachabilityFence(recipient_onion); - Reference.reachabilityFence(payment_id); - 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); }; - return ret_hu_conv; - } - - /** - * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route - * based on `route_params` and retry failed payment paths based on `retry_strategy`. + * See [`send_payment`] documentation for more details on the idempotency guarantees provided by + * the [`PaymentId`] key. * * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous * payments. * + * [`send_payment`]: Self::send_payment * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend */ - public Result_ThirtyTwoBytesRetryableSendFailureZ send_spontaneous_payment_with_retry(org.ldk.structs.Option_ThirtyTwoBytesZ payment_preimage, org.ldk.structs.RecipientOnionFields recipient_onion, byte[] payment_id, org.ldk.structs.RouteParameters route_params, org.ldk.structs.Retry retry_strategy) { - long ret = bindings.ChannelManager_send_spontaneous_payment_with_retry(this.ptr, payment_preimage.ptr, recipient_onion.ptr, InternalUtils.check_arr_len(payment_id, 32), route_params.ptr, retry_strategy.ptr); + public Result_ThirtyTwoBytesRetryableSendFailureZ send_spontaneous_payment(org.ldk.structs.Option_ThirtyTwoBytesZ payment_preimage, org.ldk.structs.RecipientOnionFields recipient_onion, byte[] payment_id, org.ldk.structs.RouteParameters route_params, org.ldk.structs.Retry retry_strategy) { + long ret = bindings.ChannelManager_send_spontaneous_payment(this.ptr, payment_preimage.ptr, recipient_onion.ptr, InternalUtils.check_arr_len(payment_id, 32), route_params.ptr, retry_strategy.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(payment_preimage); Reference.reachabilityFence(recipient_onion); @@ -1275,12 +1263,12 @@ public class ChannelManager extends CommonBase { * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows * us to easily discern them from real payments. */ - public Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ send_probe(org.ldk.structs.Path path) { + public Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ send_probe(org.ldk.structs.Path path) { long ret = bindings.ChannelManager_send_probe(this.ptr, path.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(path); if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.constr_from_ptr(ret); + Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -1587,7 +1575,7 @@ public class ChannelManager extends CommonBase { * Forgetting about stale outbound payments, either those that have already been fulfilled * or those awaiting an invoice that hasn't been delivered in the necessary amount of time. * The latter is determined using the system clock in `std` and the highest seen block time - * minus two hours in `no-std`. + * minus two hours in non-`std`. * * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate * estimate fetches. @@ -1707,6 +1695,10 @@ public class ChannelManager extends CommonBase { * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be * used to accept such channels. * + * NOTE: LDK makes no attempt to prevent the counterparty from using non-standard inputs which + * will prevent the funding transaction from being relayed on the bitcoin network and hence being + * confirmed. + * * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id */ @@ -1754,6 +1746,45 @@ public class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * When a call to a [`ChannelSigner`] method returns an error, this indicates that the signer + * is (temporarily) unavailable, and the operation should be retried later. + * + * This method allows for that retry - either checking for any signer-pending messages to be + * attempted in every channel, or in the specifically provided channel. + * + * [`ChannelSigner`]: crate::sign::ChannelSigner + */ + public void signer_unblocked(org.ldk.structs.Option_C2Tuple_PublicKeyChannelIdZZ channel_opt) { + bindings.ChannelManager_signer_unblocked(this.ptr, channel_opt.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(channel_opt); + } + + /** + * Utility for creating a BOLT11 invoice that can be verified by [`ChannelManager`] without + * storing any additional state. It achieves this by including a [`PaymentSecret`] in the + * invoice which it uses to verify that the invoice has not expired and the payment amount is + * sufficient, reproducing the [`PaymentPreimage`] if applicable. + */ + public Result_Bolt11InvoiceSignOrCreationErrorZ create_bolt11_invoice(Option_u64Z params_amount_msats_arg, Bolt11InvoiceDescription params_description_arg, Option_u32Z params_invoice_expiry_delta_secs_arg, Option_u16Z params_min_final_cltv_expiry_delta_arg, Option_ThirtyTwoBytesZ params_payment_hash_arg) { + long ret = bindings.ChannelManager_create_bolt11_invoice(this.ptr, bindings.Bolt11InvoiceParameters_new(params_amount_msats_arg.ptr, params_description_arg.ptr, params_invoice_expiry_delta_secs_arg.ptr, params_min_final_cltv_expiry_delta_arg.ptr, params_payment_hash_arg.ptr)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(params_amount_msats_arg); + Reference.reachabilityFence(params_description_arg); + Reference.reachabilityFence(params_invoice_expiry_delta_secs_arg); + Reference.reachabilityFence(params_min_final_cltv_expiry_delta_arg); + Reference.reachabilityFence(params_payment_hash_arg); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + ; + ; + ; + ; + ; + return ret_hu_conv; + } + /** * Creates an [`OfferBuilder`] such that the [`Offer`] it builds is recognized by the * [`ChannelManager`] when handling [`InvoiceRequest`] messages for the offer. The offer's @@ -1799,7 +1830,7 @@ public class ChannelManager extends CommonBase { * See [Avoiding Duplicate Payments] for other requirements once the payment has been sent. * * The builder will have the provided expiration set. Any changes to the expiration on the - * returned builder will not be honored by [`ChannelManager`]. For `no-std`, the highest seen + * returned builder will not be honored by [`ChannelManager`]. For non-`std`, the highest seen * block time minus two hours is used for the current time when determining if the refund has * expired. * @@ -1884,7 +1915,7 @@ public class ChannelManager extends CommonBase { * # Limitations * * Requires a direct connection to an introduction node in [`Offer::paths`] or to - * [`Offer::signing_pubkey`], if empty. A similar restriction applies to the responding + * [`Offer::issuer_signing_pubkey`], if empty. A similar restriction applies to the responding * [`Bolt12Invoice::payment_paths`]. * * # Errors @@ -1931,9 +1962,9 @@ public class ChannelManager extends CommonBase { * # Limitations * * Requires a direct connection to an introduction node in [`Refund::paths`] or to - * [`Refund::payer_id`], if empty. This request is best effort; an invoice will be sent to each - * node meeting the aforementioned criteria, but there's no guarantee that they will be - * received and no retries will be made. + * [`Refund::payer_signing_pubkey`], if empty. This request is best effort; an invoice will be + * sent to each node meeting the aforementioned criteria, but there's no guarantee that they + * will be received and no retries will be made. * * # Errors * @@ -1954,6 +1985,62 @@ public class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Pays for an [`Offer`] looked up using [BIP 353] Human Readable Names resolved by the DNS + * resolver(s) at `dns_resolvers` which resolve names according to bLIP 32. + * + * If the wallet supports paying on-chain schemes, you should instead use + * [`OMNameResolver::resolve_name`] and [`OMNameResolver::handle_dnssec_proof_for_uri`] (by + * implementing [`DNSResolverMessageHandler`]) directly to look up a URI and then delegate to + * your normal URI handling. + * + * If `max_total_routing_fee_msat` is not specified, the default from + * [`RouteParameters::from_payment_params_and_value`] is applied. + * + * # Payment + * + * The provided `payment_id` is used to ensure that only one invoice is paid for the request + * when received. See [Avoiding Duplicate Payments] for other requirements once the payment has + * been sent. + * + * 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`]. + * + * # Privacy + * + * For payer privacy, uses a derived payer id and uses [`MessageRouter::create_blinded_paths`] + * to construct a [`BlindedPath`] for the reply path. For further privacy implications, see the + * docs of the parameterized [`Router`], which implements [`MessageRouter`]. + * + * # Limitations + * + * Requires a direct connection to the given [`Destination`] as well as an introduction node in + * [`Offer::paths`] or to [`Offer::signing_pubkey`], if empty. A similar restriction applies to + * the responding [`Bolt12Invoice::payment_paths`]. + * + * # Errors + * + * Errors if: + * - a duplicate `payment_id` is provided given the caveats in the aforementioned link, + * + * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths + * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments + */ + public Result_NoneNoneZ pay_for_offer_from_human_readable_name(org.ldk.structs.HumanReadableName name, long amount_msats, byte[] payment_id, org.ldk.structs.Retry retry_strategy, org.ldk.structs.Option_u64Z max_total_routing_fee_msat, Destination[] dns_resolvers) { + long ret = bindings.ChannelManager_pay_for_offer_from_human_readable_name(this.ptr, name.ptr, amount_msats, InternalUtils.check_arr_len(payment_id, 32), retry_strategy.ptr, max_total_routing_fee_msat.ptr, dns_resolvers != null ? Arrays.stream(dns_resolvers).mapToLong(dns_resolvers_conv_13 -> dns_resolvers_conv_13.ptr).toArray() : null); + Reference.reachabilityFence(this); + Reference.reachabilityFence(name); + Reference.reachabilityFence(amount_msats); + Reference.reachabilityFence(payment_id); + Reference.reachabilityFence(retry_strategy); + Reference.reachabilityFence(max_total_routing_fee_msat); + Reference.reachabilityFence(dns_resolvers); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Gets a payment secret and payment hash for use in an invoice given to a third party wishing * to pay us. @@ -2313,6 +2400,19 @@ public class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new DNSResolverMessageHandler which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned DNSResolverMessageHandler must be freed before this_arg is + */ + public DNSResolverMessageHandler as_DNSResolverMessageHandler() { + long ret = bindings.ChannelManager_as_DNSResolverMessageHandler(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + DNSResolverMessageHandler ret_hu_conv = new DNSResolverMessageHandler(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 b0988395..39de69d7 100644 --- a/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java +++ b/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java @@ -21,9 +21,12 @@ import javax.annotation.Nullable; * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the * same way you would handle a [`chain::Filter`] call using * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`]. - * 4) Reconnect blocks on your [`ChannelMonitor`]s. - * 5) Disconnect/connect blocks on the [`ChannelManager`]. - * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk. + * 4) Disconnect/connect blocks on your [`ChannelMonitor`]s to get them in sync with the chain. + * 5) Disconnect/connect blocks on the [`ChannelManager`] to get it in sync with the chain. + * 6) Optionally re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk. + * This is important if you have replayed a nontrivial number of blocks in step (4), allowing + * you to avoid having to replay the same blocks if you shut down quickly after startup. It is + * otherwise not required. * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in * the next step. @@ -231,6 +234,30 @@ public class ChannelManagerReadArgs extends CommonBase { if (this != null) { this.ptrs_to.add(val); }; } + /** + * The [`MessageRouter`] used for constructing [`BlindedMessagePath`]s for [`Offer`]s, + * [`Refund`]s, and any reply paths. + */ + public MessageRouter get_message_router() { + long ret = bindings.ChannelManagerReadArgs_get_message_router(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + MessageRouter ret_hu_conv = new MessageRouter(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * The [`MessageRouter`] used for constructing [`BlindedMessagePath`]s for [`Offer`]s, + * [`Refund`]s, and any reply paths. + */ + public void set_message_router(org.ldk.structs.MessageRouter val) { + bindings.ChannelManagerReadArgs_set_message_router(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + if (this != null) { this.ptrs_to.add(val); }; + } + /** * The Logger for use in the ChannelManager and which may be used to log information during * deserialization. @@ -283,8 +310,8 @@ public class ChannelManagerReadArgs extends CommonBase { * HashMap for you. This is primarily useful for C bindings where it is not practical to * populate a HashMap directly from C. */ - public static ChannelManagerReadArgs of(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.SignerProvider signer_provider, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Watch chain_monitor, org.ldk.structs.BroadcasterInterface tx_broadcaster, org.ldk.structs.Router router, org.ldk.structs.Logger logger, org.ldk.structs.UserConfig default_config, ChannelMonitor[] channel_monitors) { - long ret = bindings.ChannelManagerReadArgs_new(entropy_source.ptr, node_signer.ptr, signer_provider.ptr, fee_estimator.ptr, chain_monitor.ptr, tx_broadcaster.ptr, router.ptr, logger.ptr, default_config.ptr, channel_monitors != null ? Arrays.stream(channel_monitors).mapToLong(channel_monitors_conv_16 -> channel_monitors_conv_16.ptr).toArray() : null); + public static ChannelManagerReadArgs of(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.SignerProvider signer_provider, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Watch chain_monitor, org.ldk.structs.BroadcasterInterface tx_broadcaster, org.ldk.structs.Router router, org.ldk.structs.MessageRouter message_router, org.ldk.structs.Logger logger, org.ldk.structs.UserConfig default_config, ChannelMonitor[] channel_monitors) { + long ret = bindings.ChannelManagerReadArgs_new(entropy_source.ptr, node_signer.ptr, signer_provider.ptr, fee_estimator.ptr, chain_monitor.ptr, tx_broadcaster.ptr, router.ptr, message_router.ptr, logger.ptr, default_config.ptr, channel_monitors != null ? Arrays.stream(channel_monitors).mapToLong(channel_monitors_conv_16 -> channel_monitors_conv_16.ptr).toArray() : null); Reference.reachabilityFence(entropy_source); Reference.reachabilityFence(node_signer); Reference.reachabilityFence(signer_provider); @@ -292,6 +319,7 @@ public class ChannelManagerReadArgs extends CommonBase { Reference.reachabilityFence(chain_monitor); Reference.reachabilityFence(tx_broadcaster); Reference.reachabilityFence(router); + Reference.reachabilityFence(message_router); Reference.reachabilityFence(logger); Reference.reachabilityFence(default_config); Reference.reachabilityFence(channel_monitors); @@ -305,6 +333,7 @@ public class ChannelManagerReadArgs extends CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(chain_monitor); }; 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(message_router); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; 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 925bd4b7..a4b11a81 100644 --- a/src/main/java/org/ldk/structs/ChannelMessageHandler.java +++ b/src/main/java/org/ldk/structs/ChannelMessageHandler.java @@ -194,6 +194,15 @@ public class ChannelMessageHandler extends CommonBase { * connecting to peers. */ Option_CVec_ThirtyTwoBytesZZ get_chain_hashes(); + /** + * Indicates that a message was received from any peer for any handler. + * Called before the message is passed to the appropriate handler. + * Useful for indicating that a network connection is active. + * + * Note: Since this function is called frequently, it should be as + * efficient as possible for its intended purpose. + */ + void message_received(); } private static class LDKChannelMessageHandlerHolder { ChannelMessageHandler held; } public static ChannelMessageHandler new_impl(ChannelMessageHandlerInterface arg, MessageSendEventsProvider.MessageSendEventsProviderInterface MessageSendEventsProvider_impl) { @@ -378,6 +387,10 @@ public class ChannelMessageHandler extends CommonBase { long result = ret.clone_ptr(); return result; } + @Override public void message_received() { + arg.message_received(); + Reference.reachabilityFence(arg); + } }, MessageSendEventsProvider.new_impl(MessageSendEventsProvider_impl).bindings_instance); return impl_holder.held; } @@ -795,4 +808,17 @@ public class ChannelMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Indicates that a message was received from any peer for any handler. + * Called before the message is passed to the appropriate handler. + * Useful for indicating that a network connection is active. + * + * Note: Since this function is called frequently, it should be as + * efficient as possible for its intended purpose. + */ + public void message_received() { + bindings.ChannelMessageHandler_message_received(this.ptr); + Reference.reachabilityFence(this); + } + } diff --git a/src/main/java/org/ldk/structs/ChannelMonitor.java b/src/main/java/org/ldk/structs/ChannelMonitor.java index 2148d7af..ddc0e7c1 100644 --- a/src/main/java/org/ldk/structs/ChannelMonitor.java +++ b/src/main/java/org/ldk/structs/ChannelMonitor.java @@ -82,6 +82,8 @@ public class ChannelMonitor extends CommonBase { /** * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this * ChannelMonitor. + * + * Note that for channels closed prior to LDK 0.1, this may return [`u64::MAX`]. */ public long get_latest_update_id() { long ret = bindings.ChannelMonitor_get_latest_update_id(this.ptr); @@ -180,13 +182,15 @@ public class ChannelMonitor extends CommonBase { * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs * [`BumpTransaction`]: crate::events::Event::BumpTransaction */ - public Result_NoneReplayEventZ process_pending_events(org.ldk.structs.EventHandler handler) { - long ret = bindings.ChannelMonitor_process_pending_events(this.ptr, handler.ptr); + public Result_NoneReplayEventZ process_pending_events(org.ldk.structs.EventHandler handler, org.ldk.structs.Logger logger) { + long ret = bindings.ChannelMonitor_process_pending_events(this.ptr, handler.ptr, logger.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(handler); + Reference.reachabilityFence(logger); 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); }; + if (this != null) { this.ptrs_to.add(logger); }; return ret_hu_conv; } @@ -568,17 +572,28 @@ public class ChannelMonitor extends CommonBase { /** * Checks if the monitor is fully resolved. Resolved monitor is one that has claimed all of - * its outputs and balances (i.e. [`Self::get_claimable_balances`] returns an empty set). + * its outputs and balances (i.e. [`Self::get_claimable_balances`] returns an empty set) and + * which does not have any payment preimages for HTLCs which are still pending on other + * channels. + * + * Additionally may update state to track when the balances set became empty. + * + * This function returns a tuple of two booleans, the first indicating whether the monitor is + * fully resolved, and the second whether the monitor needs persistence to ensure it is + * reliably marked as resolved within 4032 blocks. * - * This function returns true only if [`Self::get_claimable_balances`] has been empty for at least + * The first boolean is true only if [`Self::get_claimable_balances`] has been empty for at least * 4032 blocks as an additional protection against any bugs resulting in spuriously empty balance sets. */ - public boolean is_fully_resolved(org.ldk.structs.Logger logger) { - boolean ret = bindings.ChannelMonitor_is_fully_resolved(this.ptr, logger.ptr); + public TwoTuple_boolboolZ check_and_update_full_resolution_status(org.ldk.structs.Logger logger) { + long ret = bindings.ChannelMonitor_check_and_update_full_resolution_status(this.ptr, logger.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(logger); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_boolboolZ ret_hu_conv = new TwoTuple_boolboolZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; if (this != null) { this.ptrs_to.add(logger); }; - return ret; + return ret_hu_conv; } /** diff --git a/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java b/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java index cacb402b..7fc8420d 100644 --- a/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java +++ b/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java @@ -35,11 +35,9 @@ public class ChannelMonitorUpdate extends CommonBase { * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given * ChannelMonitor when ChannelManager::channel_monitor_updated is called. * - * The only instances we allow where update_id values are not strictly increasing have a - * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that - * will force close the channel by broadcasting the latest commitment transaction or - * special post-force-close updates, like providing preimages necessary to claim outputs on the - * broadcast commitment transaction. See its docs for more details. + * Note that for [`ChannelMonitorUpdate`]s generated on LDK versions prior to 0.1 after the + * channel was closed, this value may be [`u64::MAX`]. In that case, multiple updates may + * appear with the same ID, and all should be replayed. * * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress */ @@ -58,11 +56,9 @@ public class ChannelMonitorUpdate extends CommonBase { * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given * ChannelMonitor when ChannelManager::channel_monitor_updated is called. * - * The only instances we allow where update_id values are not strictly increasing have a - * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that - * will force close the channel by broadcasting the latest commitment transaction or - * special post-force-close updates, like providing preimages necessary to claim outputs on the - * broadcast commitment transaction. See its docs for more details. + * Note that for [`ChannelMonitorUpdate`]s generated on LDK versions prior to 0.1 after the + * channel was closed, this value may be [`u64::MAX`]. In that case, multiple updates may + * appear with the same ID, and all should be replayed. * * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress */ diff --git a/src/main/java/org/ldk/structs/ChannelSigner.java b/src/main/java/org/ldk/structs/ChannelSigner.java index 6874bdf1..081ee698 100644 --- a/src/main/java/org/ldk/structs/ChannelSigner.java +++ b/src/main/java/org/ldk/structs/ChannelSigner.java @@ -11,9 +11,12 @@ 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. + * Several methods allow errors to be returned to support async signing. In such cases, the + * signing operation can be replayed by calling [`ChannelManager::signer_unblocked`] once the + * result is ready, at which point the channel operation will resume. Methods which allow for + * async results are explicitly documented as such + * + * [`ChannelManager::signer_unblocked`]: crate::ln::channelmanager::ChannelManager::signer_unblocked */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelSigner extends CommonBase { @@ -47,9 +50,9 @@ public class ChannelSigner extends CommonBase { * * 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. + * This method is *not* asynchronous. This method is expected to always return `Ok` + * immediately after we reconnect to peers, and returning an `Err` may lead to an immediate + * `panic`. This method will be made asynchronous in a future release. */ Result_PublicKeyNoneZ get_per_commitment_point(long idx); /** @@ -61,6 +64,12 @@ public class ChannelSigner extends CommonBase { * May be called more than once for the same index. * * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. + * + * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid + * signature and should be retried later. Once the signer is ready to provide a signature after + * previously returning an `Err`, [`ChannelManager::signer_unblocked`] must be called. + * + * [`ChannelManager::signer_unblocked`]: crate::ln::channelmanager::ChannelManager::signer_unblocked */ Result__u832NoneZ release_commitment_secret(long idx); /** @@ -77,6 +86,10 @@ public class ChannelSigner extends CommonBase { * * Note that all the relevant preimages will be provided, but there may also be additional * irrelevant or duplicate preimages. + * + * This method is *not* asynchronous. If an `Err` is returned, the channel will be immediately + * closed. If you wish to make this operation asynchronous, you should instead return `Ok(())` + * and pause future signing operations until this validation completes. */ Result_NoneNoneZ validate_holder_commitment(HolderCommitmentTransaction holder_tx, byte[][] outbound_htlc_preimages); /** @@ -84,12 +97,18 @@ public class ChannelSigner extends CommonBase { * * This is required in order for the signer to make sure that the state has moved * forward and it is safe to sign the next counterparty commitment. + * + * This method is *not* asynchronous. If an `Err` is returned, the channel will be immediately + * closed. If you wish to make this operation asynchronous, you should instead return `Ok(())` + * and pause future signing operations until this validation completes. */ Result_NoneNoneZ validate_counterparty_revocation(long idx, byte[] secret); /** * Returns an arbitrary identifier describing the set of keys which are provided back to you in * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this * [`EcdsaChannelSigner`] object uniquely and lookup or re-derive its keys. + * + * This method is *not* asynchronous. Instead, the value must be cached locally. */ byte[] channel_keys_id(); /** @@ -153,9 +172,9 @@ public class ChannelSigner extends CommonBase { * * 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. + * This method is *not* asynchronous. This method is expected to always return `Ok` + * immediately after we reconnect to peers, and returning an `Err` may lead to an immediate + * `panic`. This method will be made asynchronous in a future release. */ public Result_PublicKeyNoneZ get_per_commitment_point(long idx) { long ret = bindings.ChannelSigner_get_per_commitment_point(this.ptr, idx); @@ -175,6 +194,12 @@ public class ChannelSigner extends CommonBase { * May be called more than once for the same index. * * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. + * + * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid + * signature and should be retried later. Once the signer is ready to provide a signature after + * previously returning an `Err`, [`ChannelManager::signer_unblocked`] must be called. + * + * [`ChannelManager::signer_unblocked`]: crate::ln::channelmanager::ChannelManager::signer_unblocked */ public Result__u832NoneZ release_commitment_secret(long idx) { long ret = bindings.ChannelSigner_release_commitment_secret(this.ptr, idx); @@ -199,6 +224,10 @@ public class ChannelSigner extends CommonBase { * * Note that all the relevant preimages will be provided, but there may also be additional * irrelevant or duplicate preimages. + * + * This method is *not* asynchronous. If an `Err` is returned, the channel will be immediately + * closed. If you wish to make this operation asynchronous, you should instead return `Ok(())` + * and pause future signing operations until this validation completes. */ public Result_NoneNoneZ validate_holder_commitment(org.ldk.structs.HolderCommitmentTransaction holder_tx, byte[][] outbound_htlc_preimages) { long ret = bindings.ChannelSigner_validate_holder_commitment(this.ptr, holder_tx.ptr, outbound_htlc_preimages != null ? Arrays.stream(outbound_htlc_preimages).map(outbound_htlc_preimages_conv_8 -> InternalUtils.check_arr_len(outbound_htlc_preimages_conv_8, 32)).toArray(byte[][]::new) : null); @@ -216,6 +245,10 @@ public class ChannelSigner extends CommonBase { * * This is required in order for the signer to make sure that the state has moved * forward and it is safe to sign the next counterparty commitment. + * + * This method is *not* asynchronous. If an `Err` is returned, the channel will be immediately + * closed. If you wish to make this operation asynchronous, you should instead return `Ok(())` + * and pause future signing operations until this validation completes. */ public Result_NoneNoneZ validate_counterparty_revocation(long idx, byte[] secret) { long ret = bindings.ChannelSigner_validate_counterparty_revocation(this.ptr, idx, InternalUtils.check_arr_len(secret, 32)); @@ -231,6 +264,8 @@ public class ChannelSigner extends CommonBase { * Returns an arbitrary identifier describing the set of keys which are provided back to you in * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this * [`EcdsaChannelSigner`] object uniquely and lookup or re-derive its keys. + * + * This method is *not* asynchronous. Instead, the value must be cached locally. */ public byte[] channel_keys_id() { byte[] ret = bindings.ChannelSigner_channel_keys_id(this.ptr); diff --git a/src/main/java/org/ldk/structs/CommonAcceptChannelFields.java b/src/main/java/org/ldk/structs/CommonAcceptChannelFields.java index c144f439..5268387d 100644 --- a/src/main/java/org/ldk/structs/CommonAcceptChannelFields.java +++ b/src/main/java/org/ldk/structs/CommonAcceptChannelFields.java @@ -9,9 +9,10 @@ import javax.annotation.Nullable; /** - * Contains fields that are both common to [`accept_channel`] and `accept_channel2` messages. + * Contains fields that are both common to [`accept_channel`] and [`accept_channel2`] messages. * * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message + * [`accept_channel2`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel2-message */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class CommonAcceptChannelFields extends CommonBase { diff --git a/src/main/java/org/ldk/structs/CommonOpenChannelFields.java b/src/main/java/org/ldk/structs/CommonOpenChannelFields.java index 6e24ae65..c7496a9f 100644 --- a/src/main/java/org/ldk/structs/CommonOpenChannelFields.java +++ b/src/main/java/org/ldk/structs/CommonOpenChannelFields.java @@ -9,9 +9,10 @@ import javax.annotation.Nullable; /** - * Contains fields that are both common to [`open_channel`] and `open_channel2` messages. + * Contains fields that are both common to [`open_channel`] and [`open_channel2`] messages. * * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message + * [`open_channel2`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel2-message */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class CommonOpenChannelFields extends CommonBase { diff --git a/src/main/java/org/ldk/structs/DNSResolverContext.java b/src/main/java/org/ldk/structs/DNSResolverContext.java new file mode 100644 index 00000000..4db793a3 --- /dev/null +++ b/src/main/java/org/ldk/structs/DNSResolverContext.java @@ -0,0 +1,130 @@ +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 a simple nonce for use in a blinded path's context. + * + * Such a context is required when receiving a [`DNSSECProof`] message. + * + * [`DNSSECProof`]: crate::onion_message::dns_resolution::DNSSECProof + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class DNSResolverContext extends CommonBase { + DNSResolverContext(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.DNSResolverContext_free(ptr); } + } + + /** + * A nonce which uniquely describes a DNS resolution. + * + * When we receive a DNSSEC proof message, we should check that it was sent over the blinded + * path we included in the request by comparing a stored nonce with this one. + */ + public byte[] get_nonce() { + byte[] ret = bindings.DNSResolverContext_get_nonce(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * A nonce which uniquely describes a DNS resolution. + * + * When we receive a DNSSEC proof message, we should check that it was sent over the blinded + * path we included in the request by comparing a stored nonce with this one. + */ + public void set_nonce(byte[] val) { + bindings.DNSResolverContext_set_nonce(this.ptr, InternalUtils.check_arr_len(val, 16)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Constructs a new DNSResolverContext given each field + */ + public static DNSResolverContext of(byte[] nonce_arg) { + long ret = bindings.DNSResolverContext_new(InternalUtils.check_arr_len(nonce_arg, 16)); + Reference.reachabilityFence(nonce_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.DNSResolverContext ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DNSResolverContext(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.DNSResolverContext_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the DNSResolverContext + */ + public DNSResolverContext clone() { + long ret = bindings.DNSResolverContext_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.DNSResolverContext ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DNSResolverContext(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 DNSResolverContext. + */ + public long hash() { + long ret = bindings.DNSResolverContext_hash(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + @Override public int hashCode() { + return (int)this.hash(); + } + /** + * Checks if two DNSResolverContexts 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.DNSResolverContext b) { + boolean ret = bindings.DNSResolverContext_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 DNSResolverContext)) return false; + return this.eq((DNSResolverContext)o); + } + /** + * Serialize the DNSResolverContext object into a byte array which can be read by DNSResolverContext_read + */ + public byte[] write() { + byte[] ret = bindings.DNSResolverContext_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a DNSResolverContext from a byte array, created by DNSResolverContext_write + */ + public static Result_DNSResolverContextDecodeErrorZ read(byte[] ser) { + long ret = bindings.DNSResolverContext_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_DNSResolverContextDecodeErrorZ ret_hu_conv = Result_DNSResolverContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/DNSResolverMessage.java b/src/main/java/org/ldk/structs/DNSResolverMessage.java new file mode 100644 index 00000000..66d6d205 --- /dev/null +++ b/src/main/java/org/ldk/structs/DNSResolverMessage.java @@ -0,0 +1,163 @@ +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 containing the possible onion messages which are used uses to request and receive + * DNSSEC proofs. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class DNSResolverMessage extends CommonBase { + private DNSResolverMessage(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.DNSResolverMessage_free(ptr); } + } + static DNSResolverMessage constr_from_ptr(long ptr) { + bindings.LDKDNSResolverMessage raw_val = bindings.LDKDNSResolverMessage_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKDNSResolverMessage.DNSSECQuery.class) { + return new DNSSECQuery(ptr, (bindings.LDKDNSResolverMessage.DNSSECQuery)raw_val); + } + if (raw_val.getClass() == bindings.LDKDNSResolverMessage.DNSSECProof.class) { + return new DNSSECProof(ptr, (bindings.LDKDNSResolverMessage.DNSSECProof)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * A query requesting a DNSSEC proof + */ + public final static class DNSSECQuery extends DNSResolverMessage { + public final org.ldk.structs.DNSSECQuery dnssec_query; + private DNSSECQuery(long ptr, bindings.LDKDNSResolverMessage.DNSSECQuery obj) { + super(null, ptr); + long dnssec_query = obj.dnssec_query; + org.ldk.structs.DNSSECQuery dnssec_query_hu_conv = null; if (dnssec_query < 0 || dnssec_query > 4096) { dnssec_query_hu_conv = new org.ldk.structs.DNSSECQuery(null, dnssec_query); } + if (dnssec_query_hu_conv != null) { dnssec_query_hu_conv.ptrs_to.add(this); }; + this.dnssec_query = dnssec_query_hu_conv; + } + } + /** + * A response containing a DNSSEC proof + */ + public final static class DNSSECProof extends DNSResolverMessage { + public final org.ldk.structs.DNSSECProof dnssec_proof; + private DNSSECProof(long ptr, bindings.LDKDNSResolverMessage.DNSSECProof obj) { + super(null, ptr); + long dnssec_proof = obj.dnssec_proof; + org.ldk.structs.DNSSECProof dnssec_proof_hu_conv = null; if (dnssec_proof < 0 || dnssec_proof > 4096) { dnssec_proof_hu_conv = new org.ldk.structs.DNSSECProof(null, dnssec_proof); } + if (dnssec_proof_hu_conv != null) { dnssec_proof_hu_conv.ptrs_to.add(this); }; + this.dnssec_proof = dnssec_proof_hu_conv; + } + } + long clone_ptr() { + long ret = bindings.DNSResolverMessage_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the DNSResolverMessage + */ + public DNSResolverMessage clone() { + long ret = bindings.DNSResolverMessage_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.DNSResolverMessage ret_hu_conv = org.ldk.structs.DNSResolverMessage.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 DNSSECQuery-variant DNSResolverMessage + */ + public static DNSResolverMessage dnssecquery(org.ldk.structs.DNSSECQuery a) { + long ret = bindings.DNSResolverMessage_dnssecquery(a.ptr); + Reference.reachabilityFence(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.DNSResolverMessage ret_hu_conv = org.ldk.structs.DNSResolverMessage.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 DNSSECProof-variant DNSResolverMessage + */ + public static DNSResolverMessage dnssecproof(org.ldk.structs.DNSSECProof a) { + long ret = bindings.DNSResolverMessage_dnssecproof(a.ptr); + Reference.reachabilityFence(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.DNSResolverMessage ret_hu_conv = org.ldk.structs.DNSResolverMessage.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the DNSResolverMessage. + */ + public long hash() { + long ret = bindings.DNSResolverMessage_hash(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + @Override public int hashCode() { + return (int)this.hash(); + } + /** + * Checks if two DNSResolverMessages contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public boolean eq(org.ldk.structs.DNSResolverMessage b) { + boolean ret = bindings.DNSResolverMessage_eq(this.ptr, b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof DNSResolverMessage)) return false; + return this.eq((DNSResolverMessage)o); + } + /** + * Serialize the DNSResolverMessage object into a byte array which can be read by DNSResolverMessage_read + */ + public byte[] write() { + byte[] ret = bindings.DNSResolverMessage_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a DNSResolverMessage from a byte array, created by DNSResolverMessage_write + */ + public static Result_DNSResolverMessageDecodeErrorZ read(byte[] ser, long arg) { + long ret = bindings.DNSResolverMessage_read(ser, arg); + Reference.reachabilityFence(ser); + Reference.reachabilityFence(arg); + if (ret >= 0 && ret <= 4096) { return null; } + Result_DNSResolverMessageDecodeErrorZ ret_hu_conv = Result_DNSResolverMessageDecodeErrorZ.constr_from_ptr(ret); + 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.DNSResolverMessage_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; + } + +} diff --git a/src/main/java/org/ldk/structs/DNSResolverMessageHandler.java b/src/main/java/org/ldk/structs/DNSResolverMessageHandler.java new file mode 100644 index 00000000..c5df22d2 --- /dev/null +++ b/src/main/java/org/ldk/structs/DNSResolverMessageHandler.java @@ -0,0 +1,167 @@ +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 a DNS(SEC) query or a DNSSEC proof + * + * [`OnionMessage`]: crate::ln::msgs::OnionMessage + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class DNSResolverMessageHandler extends CommonBase { + final bindings.LDKDNSResolverMessageHandler bindings_instance; + DNSResolverMessageHandler(Object _dummy, long ptr) { super(ptr); bindings_instance = null; } + private DNSResolverMessageHandler(bindings.LDKDNSResolverMessageHandler arg) { + super(bindings.LDKDNSResolverMessageHandler_new(arg)); + this.ptrs_to.add(arg); + this.bindings_instance = arg; + } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.DNSResolverMessageHandler_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.DNSResolverMessageHandler_free(ptr); } + ptr = 0; + } + public static interface DNSResolverMessageHandlerInterface { + /** + * Handle a [`DNSSECQuery`] message. + * + * If we provide DNS resolution services to third parties, we should respond with a + * [`DNSSECProof`] message. + * + * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + Option_C2Tuple_DNSResolverMessageResponseInstructionZZ handle_dnssec_query(DNSSECQuery message, Responder responder); + /** + * Handle a [`DNSSECProof`] message (in response to a [`DNSSECQuery`] we presumably sent). + * + * With this, we should be able to validate the DNS record we requested. + */ + void handle_dnssec_proof(DNSSECProof message, DNSResolverContext context); + /** + * Gets the node feature flags which this handler itself supports. Useful for setting the + * `dns_resolver` flag if this handler supports returning [`DNSSECProof`] messages in response + * to [`DNSSECQuery`] messages. + */ + NodeFeatures provided_node_features(); + /** + * Release any [`DNSResolverMessage`]s that need to be sent. + */ + TwoTuple_DNSResolverMessageMessageSendInstructionsZ[] release_pending_messages(); + } + private static class LDKDNSResolverMessageHandlerHolder { DNSResolverMessageHandler held; } + public static DNSResolverMessageHandler new_impl(DNSResolverMessageHandlerInterface arg) { + final LDKDNSResolverMessageHandlerHolder impl_holder = new LDKDNSResolverMessageHandlerHolder(); + impl_holder.held = new DNSResolverMessageHandler(new bindings.LDKDNSResolverMessageHandler() { + @Override public long handle_dnssec_query(long message, long responder) { + org.ldk.structs.DNSSECQuery message_hu_conv = null; if (message < 0 || message > 4096) { message_hu_conv = new org.ldk.structs.DNSSECQuery(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_DNSResolverMessageResponseInstructionZZ ret = arg.handle_dnssec_query(message_hu_conv, responder_hu_conv); + Reference.reachabilityFence(arg); + long result = ret.clone_ptr(); + return result; + } + @Override public void handle_dnssec_proof(long message, long context) { + org.ldk.structs.DNSSECProof message_hu_conv = null; if (message < 0 || message > 4096) { message_hu_conv = new org.ldk.structs.DNSSECProof(null, message); } + if (message_hu_conv != null) { message_hu_conv.ptrs_to.add(this); }; + org.ldk.structs.DNSResolverContext context_hu_conv = null; if (context < 0 || context > 4096) { context_hu_conv = new org.ldk.structs.DNSResolverContext(null, context); } + if (context_hu_conv != null) { context_hu_conv.ptrs_to.add(this); }; + arg.handle_dnssec_proof(message_hu_conv, context_hu_conv); + Reference.reachabilityFence(arg); + } + @Override public long provided_node_features() { + NodeFeatures ret = arg.provided_node_features(); + Reference.reachabilityFence(arg); + long result = ret.clone_ptr(); + return result; + } + @Override public long[] release_pending_messages() { + TwoTuple_DNSResolverMessageMessageSendInstructionsZ[] ret = arg.release_pending_messages(); + Reference.reachabilityFence(arg); + long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_53 -> ret_conv_53.clone_ptr()).toArray() : null; + return result; + } + }); + return impl_holder.held; + } + /** + * Handle a [`DNSSECQuery`] message. + * + * If we provide DNS resolution services to third parties, we should respond with a + * [`DNSSECProof`] message. + * + * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public Option_C2Tuple_DNSResolverMessageResponseInstructionZZ handle_dnssec_query(org.ldk.structs.DNSSECQuery message, @Nullable org.ldk.structs.Responder responder) { + long ret = bindings.DNSResolverMessageHandler_handle_dnssec_query(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_DNSResolverMessageResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_DNSResolverMessageResponseInstructionZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Handle a [`DNSSECProof`] message (in response to a [`DNSSECQuery`] we presumably sent). + * + * With this, we should be able to validate the DNS record we requested. + */ + public void handle_dnssec_proof(org.ldk.structs.DNSSECProof message, org.ldk.structs.DNSResolverContext context) { + bindings.DNSResolverMessageHandler_handle_dnssec_proof(this.ptr, message.ptr, context.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(message); + Reference.reachabilityFence(context); + } + + /** + * Gets the node feature flags which this handler itself supports. Useful for setting the + * `dns_resolver` flag if this handler supports returning [`DNSSECProof`] messages in response + * to [`DNSSECQuery`] messages. + */ + public NodeFeatures provided_node_features() { + long ret = bindings.DNSResolverMessageHandler_provided_node_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; + } + + /** + * Release any [`DNSResolverMessage`]s that need to be sent. + */ + public TwoTuple_DNSResolverMessageMessageSendInstructionsZ[] release_pending_messages() { + long[] ret = bindings.DNSResolverMessageHandler_release_pending_messages(this.ptr); + Reference.reachabilityFence(this); + int ret_conv_53_len = ret.length; + TwoTuple_DNSResolverMessageMessageSendInstructionsZ[] ret_conv_53_arr = new TwoTuple_DNSResolverMessageMessageSendInstructionsZ[ret_conv_53_len]; + for (int b = 0; b < ret_conv_53_len; b++) { + long ret_conv_53 = ret[b]; + TwoTuple_DNSResolverMessageMessageSendInstructionsZ ret_conv_53_hu_conv = new TwoTuple_DNSResolverMessageMessageSendInstructionsZ(null, ret_conv_53); + if (ret_conv_53_hu_conv != null) { ret_conv_53_hu_conv.ptrs_to.add(this); }; + ret_conv_53_arr[b] = ret_conv_53_hu_conv; + } + return ret_conv_53_arr; + } + +} diff --git a/src/main/java/org/ldk/structs/DNSSECProof.java b/src/main/java/org/ldk/structs/DNSSECProof.java new file mode 100644 index 00000000..698fef25 --- /dev/null +++ b/src/main/java/org/ldk/structs/DNSSECProof.java @@ -0,0 +1,94 @@ +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 message which is sent in response to [`DNSSECQuery`] containing a DNSSEC proof. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class DNSSECProof extends CommonBase { + DNSSECProof(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.DNSSECProof_free(ptr); } + } + + /** + * An [RFC 9102 DNSSEC AuthenticationChain] providing a DNSSEC proof. + * + * [RFC 9102 DNSSEC AuthenticationChain]: https://www.rfc-editor.org/rfc/rfc9102.html#name-dnssec-authentication-chain + * + * Returns a copy of the field. + */ + public byte[] get_proof() { + byte[] ret = bindings.DNSSECProof_get_proof(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * An [RFC 9102 DNSSEC AuthenticationChain] providing a DNSSEC proof. + * + * [RFC 9102 DNSSEC AuthenticationChain]: https://www.rfc-editor.org/rfc/rfc9102.html#name-dnssec-authentication-chain + */ + public void set_proof(byte[] val) { + bindings.DNSSECProof_set_proof(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + long clone_ptr() { + long ret = bindings.DNSSECProof_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the DNSSECProof + */ + public DNSSECProof clone() { + long ret = bindings.DNSSECProof_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.DNSSECProof ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DNSSECProof(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 DNSSECProof. + */ + public long hash() { + long ret = bindings.DNSSECProof_hash(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + @Override public int hashCode() { + return (int)this.hash(); + } + /** + * Checks if two DNSSECProofs 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.DNSSECProof b) { + boolean ret = bindings.DNSSECProof_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 DNSSECProof)) return false; + return this.eq((DNSSECProof)o); + } +} diff --git a/src/main/java/org/ldk/structs/DNSSECQuery.java b/src/main/java/org/ldk/structs/DNSSECQuery.java new file mode 100644 index 00000000..67a8588b --- /dev/null +++ b/src/main/java/org/ldk/structs/DNSSECQuery.java @@ -0,0 +1,70 @@ +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 message which is sent to a DNSSEC prover requesting a DNSSEC proof for the given name. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class DNSSECQuery extends CommonBase { + DNSSECQuery(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.DNSSECQuery_free(ptr); } + } + + long clone_ptr() { + long ret = bindings.DNSSECQuery_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the DNSSECQuery + */ + public DNSSECQuery clone() { + long ret = bindings.DNSSECQuery_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.DNSSECQuery ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DNSSECQuery(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 DNSSECQuery. + */ + public long hash() { + long ret = bindings.DNSSECQuery_hash(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + @Override public int hashCode() { + return (int)this.hash(); + } + /** + * Checks if two DNSSECQuerys 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.DNSSECQuery b) { + boolean ret = bindings.DNSSECQuery_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 DNSSECQuery)) return false; + return this.eq((DNSSECQuery)o); + } +} diff --git a/src/main/java/org/ldk/structs/DecodeError.java b/src/main/java/org/ldk/structs/DecodeError.java index 39e16610..570fff7f 100644 --- a/src/main/java/org/ldk/structs/DecodeError.java +++ b/src/main/java/org/ldk/structs/DecodeError.java @@ -95,7 +95,7 @@ public class DecodeError extends CommonBase { } } /** - * Error from [`std::io`]. + * Error from [`crate::io`]. */ public final static class Io extends DecodeError { public final org.ldk.enums.IOError io; diff --git a/src/main/java/org/ldk/structs/DefaultRouter.java b/src/main/java/org/ldk/structs/DefaultRouter.java index 49fc7967..6a99865f 100644 --- a/src/main/java/org/ldk/structs/DefaultRouter.java +++ b/src/main/java/org/ldk/structs/DefaultRouter.java @@ -13,8 +13,10 @@ import javax.annotation.Nullable; * * # Privacy * - * Implements [`MessageRouter`] by delegating to [`DefaultMessageRouter`]. See those docs for - * privacy implications. + * Creating [`BlindedPaymentPath`]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 + * payment, and thus an `Err` is returned. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class DefaultRouter extends CommonBase { @@ -58,17 +60,4 @@ public class DefaultRouter extends CommonBase { return ret_hu_conv; } - /** - * Constructs a new MessageRouter which calls the relevant methods on this_arg. - * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is - */ - public MessageRouter as_MessageRouter() { - long ret = bindings.DefaultRouter_as_MessageRouter(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - MessageRouter ret_hu_conv = new MessageRouter(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/Description.java b/src/main/java/org/ldk/structs/Description.java index 7c88e91b..8b7d64d9 100644 --- a/src/main/java/org/ldk/structs/Description.java +++ b/src/main/java/org/ldk/structs/Description.java @@ -84,6 +84,17 @@ public class Description extends CommonBase { return ret_hu_conv; } + /** + * Creates an empty `Description`. + */ + public static Description empty() { + long ret = bindings.Description_empty(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Description ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Description(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + /** * Returns the underlying description [`UntrustedString`] */ diff --git a/src/main/java/org/ldk/structs/EcdsaChannelSigner.java b/src/main/java/org/ldk/structs/EcdsaChannelSigner.java index 82f6e673..c228a19a 100644 --- a/src/main/java/org/ldk/structs/EcdsaChannelSigner.java +++ b/src/main/java/org/ldk/structs/EcdsaChannelSigner.java @@ -15,6 +15,15 @@ import javax.annotation.Nullable; * policies in order to be secure. Please refer to the [VLS Policy * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md) * for an example of such policies. + * + * Like [`ChannelSigner`], many of the methods allow errors to be returned to support async + * signing. In such cases, the signing operation can be replayed by calling + * [`ChannelManager::signer_unblocked`] or [`ChainMonitor::signer_unblocked`] (see individual + * method documentation for which method should be called) once the result is ready, at which + * point the channel operation will resume. + * + * [`ChannelManager::signer_unblocked`]: crate::ln::channelmanager::ChannelManager::signer_unblocked + * [`ChainMonitor::signer_unblocked`]: crate::chain::chainmonitor::ChainMonitor::signer_unblocked */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class EcdsaChannelSigner extends CommonBase { @@ -47,8 +56,6 @@ public class EcdsaChannelSigner extends CommonBase { /** * Create a signature for a counterparty's commitment transaction and associated HTLC transactions. * - * Note that if signing fails or is rejected, the channel will be force-closed. - * * Policy checks should be implemented in this function, including checking the amount * sent to us and checking the HTLCs. * @@ -59,6 +66,12 @@ public class EcdsaChannelSigner extends CommonBase { * * Note that all the relevant preimages will be provided, but there may also be additional * irrelevant or duplicate preimages. + * + * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid + * signature and should be retried later. Once the signer is ready to provide a signature after + * previously returning an `Err`, [`ChannelManager::signer_unblocked`] must be called. + * + * [`ChannelManager::signer_unblocked`]: crate::ln::channelmanager::ChannelManager::signer_unblocked */ Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx, byte[][] inbound_htlc_preimages, byte[][] outbound_htlc_preimages); /** @@ -75,9 +88,10 @@ public class EcdsaChannelSigner extends CommonBase { * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid * signature and should be retried later. Once the signer is ready to provide a signature after * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its - * monitor. + * monitor or [`ChainMonitor::signer_unblocked`] called to attempt unblocking all monitors. * * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked + * [`ChainMonitor::signer_unblocked`]: crate::chain::chainmonitor::ChainMonitor::signer_unblocked */ Result_ECDSASignatureNoneZ sign_holder_commitment(HolderCommitmentTransaction commitment_tx); /** @@ -99,9 +113,10 @@ public class EcdsaChannelSigner extends CommonBase { * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid * signature and should be retried later. Once the signer is ready to provide a signature after * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its - * monitor. + * monitor or [`ChainMonitor::signer_unblocked`] called to attempt unblocking all monitors. * * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked + * [`ChainMonitor::signer_unblocked`]: crate::chain::chainmonitor::ChainMonitor::signer_unblocked */ Result_ECDSASignatureNoneZ sign_justice_revoked_output(byte[] justice_tx, long input, long amount, byte[] per_commitment_key); /** @@ -127,9 +142,10 @@ public class EcdsaChannelSigner extends CommonBase { * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid * signature and should be retried later. Once the signer is ready to provide a signature after * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its - * monitor. + * monitor or [`ChainMonitor::signer_unblocked`] called to attempt unblocking all monitors. * * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked + * [`ChainMonitor::signer_unblocked`]: crate::chain::chainmonitor::ChainMonitor::signer_unblocked */ Result_ECDSASignatureNoneZ sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc); /** @@ -144,11 +160,12 @@ public class EcdsaChannelSigner extends CommonBase { * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid * signature and should be retried later. Once the signer is ready to provide a signature after * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its - * monitor. + * monitor or [`ChainMonitor::signer_unblocked`] called to attempt unblocking all monitors. * * [`EcdsaSighashType::All`]: bitcoin::sighash::EcdsaSighashType::All * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked + * [`ChainMonitor::signer_unblocked`]: crate::chain::chainmonitor::ChainMonitor::signer_unblocked */ Result_ECDSASignatureNoneZ sign_holder_htlc_transaction(byte[] htlc_tx, long input, HTLCDescriptor htlc_descriptor); /** @@ -173,9 +190,10 @@ public class EcdsaChannelSigner extends CommonBase { * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid * signature and should be retried later. Once the signer is ready to provide a signature after * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its - * monitor. + * monitor or [`ChainMonitor::signer_unblocked`] called to attempt unblocking all monitors. * * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked + * [`ChainMonitor::signer_unblocked`]: crate::chain::chainmonitor::ChainMonitor::signer_unblocked */ Result_ECDSASignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc); /** @@ -183,6 +201,12 @@ public class EcdsaChannelSigner extends CommonBase { * * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have * chosen to forgo their output as dust. + * + * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid + * signature and should be retried later. Once the signer is ready to provide a signature after + * previously returning an `Err`, [`ChannelManager::signer_unblocked`] must be called. + * + * [`ChannelManager::signer_unblocked`]: crate::ln::channelmanager::ChannelManager::signer_unblocked */ Result_ECDSASignatureNoneZ sign_closing_transaction(ClosingTransaction closing_tx); /** @@ -192,9 +216,10 @@ public class EcdsaChannelSigner extends CommonBase { * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid * signature and should be retried later. Once the signer is ready to provide a signature after * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its - * monitor. + * monitor or [`ChainMonitor::signer_unblocked`] called to attempt unblocking all monitors. * * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked + * [`ChainMonitor::signer_unblocked`]: crate::chain::chainmonitor::ChainMonitor::signer_unblocked */ Result_ECDSASignatureNoneZ sign_holder_anchor_input(byte[] anchor_tx, long input); /** @@ -204,13 +229,28 @@ public class EcdsaChannelSigner extends CommonBase { * Channel announcements also require a signature from each node's network key. Our node * signature is computed through [`NodeSigner::sign_gossip_message`]. * - * Note that if this fails or is rejected, the channel will not be publicly announced and - * our counterparty may (though likely will not) close the channel on us for violating the - * protocol. + * This method is *not* asynchronous. If an `Err` is returned, the channel will not be + * publicly announced and our counterparty may (though likely will not) close the channel on + * us for violating the protocol. * * [`NodeSigner::sign_gossip_message`]: crate::sign::NodeSigner::sign_gossip_message */ Result_ECDSASignatureNoneZ sign_channel_announcement_with_funding_key(UnsignedChannelAnnouncement msg); + /** + * Signs the input of a splicing funding transaction with our funding key. + * + * In splicing, the previous funding transaction output is spent as the input of + * the new funding transaction, and is a 2-of-2 multisig. + * + * `input_index`: The index of the input within the new funding transaction `tx`, + * spending the previous funding transaction's output + * + * `input_value`: The value of the previous funding transaction output. + * + * This method is *not* asynchronous. If an `Err` is returned, the channel will be immediately + * closed. + */ + Result_ECDSASignatureNoneZ sign_splicing_funding_input(byte[] tx, long input_index, long input_value); } private static class LDKEcdsaChannelSignerHolder { EcdsaChannelSigner held; } public static EcdsaChannelSigner new_impl(EcdsaChannelSignerInterface arg, ChannelSigner.ChannelSignerInterface ChannelSigner_impl, ChannelPublicKeys pubkeys) { @@ -277,6 +317,12 @@ public class EcdsaChannelSigner extends CommonBase { long result = ret.clone_ptr(); return result; } + @Override public long sign_splicing_funding_input(byte[] tx, long input_index, long input_value) { + Result_ECDSASignatureNoneZ ret = arg.sign_splicing_funding_input(tx, input_index, input_value); + Reference.reachabilityFence(arg); + long result = ret.clone_ptr(); + return result; + } }, ChannelSigner.new_impl(ChannelSigner_impl, pubkeys).bindings_instance, pubkeys); return impl_holder.held; } @@ -293,8 +339,6 @@ public class EcdsaChannelSigner extends CommonBase { /** * Create a signature for a counterparty's commitment transaction and associated HTLC transactions. * - * Note that if signing fails or is rejected, the channel will be force-closed. - * * Policy checks should be implemented in this function, including checking the amount * sent to us and checking the HTLCs. * @@ -305,6 +349,12 @@ public class EcdsaChannelSigner extends CommonBase { * * Note that all the relevant preimages will be provided, but there may also be additional * irrelevant or duplicate preimages. + * + * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid + * signature and should be retried later. Once the signer is ready to provide a signature after + * previously returning an `Err`, [`ChannelManager::signer_unblocked`] must be called. + * + * [`ChannelManager::signer_unblocked`]: crate::ln::channelmanager::ChannelManager::signer_unblocked */ public Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ sign_counterparty_commitment(org.ldk.structs.CommitmentTransaction commitment_tx, byte[][] inbound_htlc_preimages, byte[][] outbound_htlc_preimages) { long ret = bindings.EcdsaChannelSigner_sign_counterparty_commitment(this.ptr, commitment_tx.ptr, inbound_htlc_preimages != null ? Arrays.stream(inbound_htlc_preimages).map(inbound_htlc_preimages_conv_8 -> InternalUtils.check_arr_len(inbound_htlc_preimages_conv_8, 32)).toArray(byte[][]::new) : null, outbound_htlc_preimages != null ? Arrays.stream(outbound_htlc_preimages).map(outbound_htlc_preimages_conv_8 -> InternalUtils.check_arr_len(outbound_htlc_preimages_conv_8, 32)).toArray(byte[][]::new) : null); @@ -332,9 +382,10 @@ public class EcdsaChannelSigner extends CommonBase { * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid * signature and should be retried later. Once the signer is ready to provide a signature after * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its - * monitor. + * monitor or [`ChainMonitor::signer_unblocked`] called to attempt unblocking all monitors. * * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked + * [`ChainMonitor::signer_unblocked`]: crate::chain::chainmonitor::ChainMonitor::signer_unblocked */ public Result_ECDSASignatureNoneZ sign_holder_commitment(org.ldk.structs.HolderCommitmentTransaction commitment_tx) { long ret = bindings.EcdsaChannelSigner_sign_holder_commitment(this.ptr, commitment_tx.ptr); @@ -365,9 +416,10 @@ public class EcdsaChannelSigner extends CommonBase { * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid * signature and should be retried later. Once the signer is ready to provide a signature after * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its - * monitor. + * monitor or [`ChainMonitor::signer_unblocked`] called to attempt unblocking all monitors. * * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked + * [`ChainMonitor::signer_unblocked`]: crate::chain::chainmonitor::ChainMonitor::signer_unblocked */ public Result_ECDSASignatureNoneZ sign_justice_revoked_output(byte[] justice_tx, long input, long amount, byte[] per_commitment_key) { long ret = bindings.EcdsaChannelSigner_sign_justice_revoked_output(this.ptr, justice_tx, input, amount, InternalUtils.check_arr_len(per_commitment_key, 32)); @@ -404,9 +456,10 @@ public class EcdsaChannelSigner extends CommonBase { * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid * signature and should be retried later. Once the signer is ready to provide a signature after * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its - * monitor. + * monitor or [`ChainMonitor::signer_unblocked`] called to attempt unblocking all monitors. * * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked + * [`ChainMonitor::signer_unblocked`]: crate::chain::chainmonitor::ChainMonitor::signer_unblocked */ public Result_ECDSASignatureNoneZ sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, org.ldk.structs.HTLCOutputInCommitment htlc) { long ret = bindings.EcdsaChannelSigner_sign_justice_revoked_htlc(this.ptr, justice_tx, input, amount, InternalUtils.check_arr_len(per_commitment_key, 32), htlc.ptr); @@ -434,11 +487,12 @@ public class EcdsaChannelSigner extends CommonBase { * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid * signature and should be retried later. Once the signer is ready to provide a signature after * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its - * monitor. + * monitor or [`ChainMonitor::signer_unblocked`] called to attempt unblocking all monitors. * * [`EcdsaSighashType::All`]: bitcoin::sighash::EcdsaSighashType::All * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked + * [`ChainMonitor::signer_unblocked`]: crate::chain::chainmonitor::ChainMonitor::signer_unblocked */ public Result_ECDSASignatureNoneZ sign_holder_htlc_transaction(byte[] htlc_tx, long input, org.ldk.structs.HTLCDescriptor htlc_descriptor) { long ret = bindings.EcdsaChannelSigner_sign_holder_htlc_transaction(this.ptr, htlc_tx, input, htlc_descriptor.ptr); @@ -474,9 +528,10 @@ public class EcdsaChannelSigner extends CommonBase { * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid * signature and should be retried later. Once the signer is ready to provide a signature after * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its - * monitor. + * monitor or [`ChainMonitor::signer_unblocked`] called to attempt unblocking all monitors. * * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked + * [`ChainMonitor::signer_unblocked`]: crate::chain::chainmonitor::ChainMonitor::signer_unblocked */ public Result_ECDSASignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, org.ldk.structs.HTLCOutputInCommitment htlc) { long ret = bindings.EcdsaChannelSigner_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, InternalUtils.check_arr_len(per_commitment_point, 33), htlc.ptr); @@ -497,6 +552,12 @@ public class EcdsaChannelSigner extends CommonBase { * * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have * chosen to forgo their output as dust. + * + * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid + * signature and should be retried later. Once the signer is ready to provide a signature after + * previously returning an `Err`, [`ChannelManager::signer_unblocked`] must be called. + * + * [`ChannelManager::signer_unblocked`]: crate::ln::channelmanager::ChannelManager::signer_unblocked */ public Result_ECDSASignatureNoneZ sign_closing_transaction(org.ldk.structs.ClosingTransaction closing_tx) { long ret = bindings.EcdsaChannelSigner_sign_closing_transaction(this.ptr, closing_tx.ptr); @@ -515,9 +576,10 @@ public class EcdsaChannelSigner extends CommonBase { * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid * signature and should be retried later. Once the signer is ready to provide a signature after * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its - * monitor. + * monitor or [`ChainMonitor::signer_unblocked`] called to attempt unblocking all monitors. * * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked + * [`ChainMonitor::signer_unblocked`]: crate::chain::chainmonitor::ChainMonitor::signer_unblocked */ public Result_ECDSASignatureNoneZ sign_holder_anchor_input(byte[] anchor_tx, long input) { long ret = bindings.EcdsaChannelSigner_sign_holder_anchor_input(this.ptr, anchor_tx, input); @@ -536,9 +598,9 @@ public class EcdsaChannelSigner extends CommonBase { * Channel announcements also require a signature from each node's network key. Our node * signature is computed through [`NodeSigner::sign_gossip_message`]. * - * Note that if this fails or is rejected, the channel will not be publicly announced and - * our counterparty may (though likely will not) close the channel on us for violating the - * protocol. + * This method is *not* asynchronous. If an `Err` is returned, the channel will not be + * publicly announced and our counterparty may (though likely will not) close the channel on + * us for violating the protocol. * * [`NodeSigner::sign_gossip_message`]: crate::sign::NodeSigner::sign_gossip_message */ @@ -552,6 +614,31 @@ public class EcdsaChannelSigner extends CommonBase { return ret_hu_conv; } + /** + * Signs the input of a splicing funding transaction with our funding key. + * + * In splicing, the previous funding transaction output is spent as the input of + * the new funding transaction, and is a 2-of-2 multisig. + * + * `input_index`: The index of the input within the new funding transaction `tx`, + * spending the previous funding transaction's output + * + * `input_value`: The value of the previous funding transaction output. + * + * This method is *not* asynchronous. If an `Err` is returned, the channel will be immediately + * closed. + */ + public Result_ECDSASignatureNoneZ sign_splicing_funding_input(byte[] tx, long input_index, long input_value) { + long ret = bindings.EcdsaChannelSigner_sign_splicing_funding_input(this.ptr, tx, input_index, input_value); + Reference.reachabilityFence(this); + Reference.reachabilityFence(tx); + Reference.reachabilityFence(input_index); + Reference.reachabilityFence(input_value); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ECDSASignatureNoneZ ret_hu_conv = Result_ECDSASignatureNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + long clone_ptr() { long ret = bindings.EcdsaChannelSigner_clone_ptr(this.ptr); Reference.reachabilityFence(this); diff --git a/src/main/java/org/ldk/structs/Event.java b/src/main/java/org/ldk/structs/Event.java index 23432900..e0db0fc9 100644 --- a/src/main/java/org/ldk/structs/Event.java +++ b/src/main/java/org/ldk/structs/Event.java @@ -337,6 +337,16 @@ public class Event extends CommonBase { * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds */ public final org.ldk.structs.Option_u32Z claim_deadline; + /** + * A unique ID describing this payment (derived from the list of HTLCs in the payment). + * + * Payers may pay for the same [`PaymentHash`] multiple times (though this is unsafe and + * an intermediary node may steal the funds). Thus, in order to accurately track when + * payments are received and claimed, you should use this identifier. + * + * Only filled in for payments received on LDK versions 0.1 and higher. + */ + public final org.ldk.structs.Option_ThirtyTwoBytesZ payment_id; private PaymentClaimable(long ptr, bindings.LDKEvent.PaymentClaimable obj) { super(null, ptr); this.receiver_node_id = obj.receiver_node_id; @@ -363,6 +373,10 @@ public class Event extends CommonBase { org.ldk.structs.Option_u32Z claim_deadline_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(claim_deadline); if (claim_deadline_hu_conv != null) { claim_deadline_hu_conv.ptrs_to.add(this); }; this.claim_deadline = claim_deadline_hu_conv; + long payment_id = obj.payment_id; + org.ldk.structs.Option_ThirtyTwoBytesZ payment_id_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(payment_id); + if (payment_id_hu_conv != null) { payment_id_hu_conv.ptrs_to.add(this); }; + this.payment_id = payment_id_hu_conv; } } /** @@ -431,6 +445,16 @@ public class Event extends CommonBase { * 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; + /** + * A unique ID describing this payment (derived from the list of HTLCs in the payment). + * + * Payers may pay for the same [`PaymentHash`] multiple times (though this is unsafe and + * an intermediary node may steal the funds). Thus, in order to accurately track when + * payments are received and claimed, you should use this identifier. + * + * Only filled in for payments received on LDK versions 0.1 and higher. + */ + public final org.ldk.structs.Option_ThirtyTwoBytesZ payment_id; private PaymentClaimed(long ptr, bindings.LDKEvent.PaymentClaimed obj) { super(null, ptr); this.receiver_node_id = obj.receiver_node_id; @@ -458,6 +482,10 @@ public class Event extends CommonBase { 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; + long payment_id = obj.payment_id; + org.ldk.structs.Option_ThirtyTwoBytesZ payment_id_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(payment_id); + if (payment_id_hu_conv != null) { payment_id_hu_conv.ptrs_to.add(this); }; + this.payment_id = payment_id_hu_conv; } } /** @@ -1050,6 +1078,24 @@ public class Event extends CommonBase { * events generated or serialized by versions prior to 0.0.122. */ public final org.ldk.structs.Option_U128Z next_user_channel_id; + /** + * The node id of the previous node. + * + * This is only `None` for HTLCs received prior to 0.1 or for events serialized by + * versions prior to 0.1 + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable public final byte[] prev_node_id; + /** + * The node id of the next node. + * + * This is only `None` for HTLCs received prior to 0.1 or for events serialized by + * versions prior to 0.1 + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable public final byte[] next_node_id; /** * The total fee, in milli-satoshis, which was earned as a result of the payment. * @@ -1111,6 +1157,8 @@ public class Event extends CommonBase { org.ldk.structs.Option_U128Z next_user_channel_id_hu_conv = org.ldk.structs.Option_U128Z.constr_from_ptr(next_user_channel_id); if (next_user_channel_id_hu_conv != null) { next_user_channel_id_hu_conv.ptrs_to.add(this); }; this.next_user_channel_id = next_user_channel_id_hu_conv; + this.prev_node_id = obj.prev_node_id; + this.next_node_id = obj.next_node_id; long total_fee_earned_msat = obj.total_fee_earned_msat; org.ldk.structs.Option_u64Z total_fee_earned_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(total_fee_earned_msat); if (total_fee_earned_msat_hu_conv != null) { total_fee_earned_msat_hu_conv.ptrs_to.add(this); }; @@ -1312,6 +1360,19 @@ public class Event extends CommonBase { * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None */ @Nullable public final org.ldk.structs.OutPoint channel_funding_txo; + /** + * An upper bound on the our last local balance in msats before the channel was closed. + * + * Will overstate our balance as it ignores pending outbound HTLCs and transaction fees. + * + * For more accurate balances including fee information see + * [`ChainMonitor::get_claimable_balances`]. + * + * This field will be `None` only for objects serialized prior to LDK 0.1. + * + * [`ChainMonitor::get_claimable_balances`]: crate::chain::chainmonitor::ChainMonitor::get_claimable_balances + */ + public final org.ldk.structs.Option_u64Z last_local_balance_msat; private ChannelClosed(long ptr, bindings.LDKEvent.ChannelClosed obj) { super(null, ptr); long channel_id = obj.channel_id; @@ -1334,6 +1395,10 @@ public class Event extends CommonBase { org.ldk.structs.OutPoint channel_funding_txo_hu_conv = null; if (channel_funding_txo < 0 || channel_funding_txo > 4096) { channel_funding_txo_hu_conv = new org.ldk.structs.OutPoint(null, channel_funding_txo); } if (channel_funding_txo_hu_conv != null) { channel_funding_txo_hu_conv.ptrs_to.add(this); }; this.channel_funding_txo = channel_funding_txo_hu_conv; + long last_local_balance_msat = obj.last_local_balance_msat; + org.ldk.structs.Option_u64Z last_local_balance_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(last_local_balance_msat); + if (last_local_balance_msat_hu_conv != null) { last_local_balance_msat_hu_conv.ptrs_to.add(this); }; + this.last_local_balance_msat = last_local_balance_msat_hu_conv; } } /** @@ -1370,16 +1435,17 @@ public class Event extends CommonBase { /** * Indicates a request to open a new channel by a peer. * - * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request, - * call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`] - * event will _not_ be triggered if the channel is rejected. + * To accept the request (and in the case of a dual-funded channel, not contribute funds), + * call [`ChannelManager::accept_inbound_channel`]. + * To reject the request, call [`ChannelManager::force_close_without_broadcasting_txn`]. + * Note that a ['ChannelClosed`] event will _not_ be triggered if the channel is rejected. * * 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. + * returning `Err(ReplayEvent ())`) and won't 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 @@ -1414,9 +1480,11 @@ public class Event extends CommonBase { */ public final long funding_satoshis; /** - * Our starting balance in the channel if the request is accepted, in milli-satoshi. + * If `channel_negotiation_type` is `InboundChannelFunds::DualFunded`, this indicates that the peer wishes to + * open a dual-funded channel. Otherwise, this field will be `InboundChannelFunds::PushMsats`, + * indicating the `push_msats` value our peer is pushing to us for a non-dual-funded channel. */ - public final long push_msat; + public final org.ldk.structs.InboundChannelFunds channel_negotiation_type; /** * The features that this channel will operate with. If you reject the channel, a * well-behaved counterparty may automatically re-attempt the channel with a new set of @@ -1451,7 +1519,10 @@ public class Event extends CommonBase { this.temporary_channel_id = temporary_channel_id_hu_conv; this.counterparty_node_id = obj.counterparty_node_id; this.funding_satoshis = obj.funding_satoshis; - this.push_msat = obj.push_msat; + long channel_negotiation_type = obj.channel_negotiation_type; + org.ldk.structs.InboundChannelFunds channel_negotiation_type_hu_conv = org.ldk.structs.InboundChannelFunds.constr_from_ptr(channel_negotiation_type); + if (channel_negotiation_type_hu_conv != null) { channel_negotiation_type_hu_conv.ptrs_to.add(this); }; + this.channel_negotiation_type = channel_negotiation_type_hu_conv; long channel_type = obj.channel_type; 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); }; @@ -1633,8 +1704,8 @@ public class Event extends CommonBase { /** * Utility method to constructs a new PaymentClaimable-variant Event */ - public static Event payment_claimable(byte[] receiver_node_id, byte[] payment_hash, org.ldk.structs.RecipientOnionFields onion_fields, long amount_msat, long counterparty_skimmed_fee_msat, org.ldk.structs.PaymentPurpose purpose, org.ldk.structs.ChannelId via_channel_id, org.ldk.structs.Option_U128Z via_user_channel_id, org.ldk.structs.Option_u32Z claim_deadline) { - long ret = bindings.Event_payment_claimable(InternalUtils.check_arr_len(receiver_node_id, 33), InternalUtils.check_arr_len(payment_hash, 32), onion_fields.ptr, amount_msat, counterparty_skimmed_fee_msat, purpose.ptr, via_channel_id.ptr, via_user_channel_id.ptr, claim_deadline.ptr); + public static Event payment_claimable(byte[] receiver_node_id, byte[] payment_hash, org.ldk.structs.RecipientOnionFields onion_fields, long amount_msat, long counterparty_skimmed_fee_msat, org.ldk.structs.PaymentPurpose purpose, org.ldk.structs.ChannelId via_channel_id, org.ldk.structs.Option_U128Z via_user_channel_id, org.ldk.structs.Option_u32Z claim_deadline, org.ldk.structs.Option_ThirtyTwoBytesZ payment_id) { + long ret = bindings.Event_payment_claimable(InternalUtils.check_arr_len(receiver_node_id, 33), InternalUtils.check_arr_len(payment_hash, 32), onion_fields.ptr, amount_msat, counterparty_skimmed_fee_msat, purpose.ptr, via_channel_id.ptr, via_user_channel_id.ptr, claim_deadline.ptr, payment_id.ptr); Reference.reachabilityFence(receiver_node_id); Reference.reachabilityFence(payment_hash); Reference.reachabilityFence(onion_fields); @@ -1644,6 +1715,7 @@ public class Event extends CommonBase { Reference.reachabilityFence(via_channel_id); Reference.reachabilityFence(via_user_channel_id); Reference.reachabilityFence(claim_deadline); + Reference.reachabilityFence(payment_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); }; @@ -1653,8 +1725,8 @@ public class Event extends CommonBase { /** * 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, 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); + 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, org.ldk.structs.Option_ThirtyTwoBytesZ payment_id) { + 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, payment_id.ptr); Reference.reachabilityFence(receiver_node_id); Reference.reachabilityFence(payment_hash); Reference.reachabilityFence(amount_msat); @@ -1662,6 +1734,7 @@ public class Event extends CommonBase { Reference.reachabilityFence(htlcs); Reference.reachabilityFence(sender_intended_total_msat); Reference.reachabilityFence(onion_fields); + Reference.reachabilityFence(payment_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); }; @@ -1829,12 +1902,14 @@ public class Event extends CommonBase { /** * Utility method to constructs a new PaymentForwarded-variant Event */ - public static Event payment_forwarded(org.ldk.structs.ChannelId prev_channel_id, org.ldk.structs.ChannelId next_channel_id, org.ldk.structs.Option_U128Z prev_user_channel_id, org.ldk.structs.Option_U128Z next_user_channel_id, org.ldk.structs.Option_u64Z total_fee_earned_msat, org.ldk.structs.Option_u64Z skimmed_fee_msat, boolean claim_from_onchain_tx, org.ldk.structs.Option_u64Z outbound_amount_forwarded_msat) { - long ret = bindings.Event_payment_forwarded(prev_channel_id.ptr, next_channel_id.ptr, prev_user_channel_id.ptr, next_user_channel_id.ptr, total_fee_earned_msat.ptr, skimmed_fee_msat.ptr, claim_from_onchain_tx, outbound_amount_forwarded_msat.ptr); + public static Event payment_forwarded(org.ldk.structs.ChannelId prev_channel_id, org.ldk.structs.ChannelId next_channel_id, org.ldk.structs.Option_U128Z prev_user_channel_id, org.ldk.structs.Option_U128Z next_user_channel_id, byte[] prev_node_id, byte[] next_node_id, org.ldk.structs.Option_u64Z total_fee_earned_msat, org.ldk.structs.Option_u64Z skimmed_fee_msat, boolean claim_from_onchain_tx, org.ldk.structs.Option_u64Z outbound_amount_forwarded_msat) { + long ret = bindings.Event_payment_forwarded(prev_channel_id.ptr, next_channel_id.ptr, prev_user_channel_id.ptr, next_user_channel_id.ptr, InternalUtils.check_arr_len(prev_node_id, 33), InternalUtils.check_arr_len(next_node_id, 33), total_fee_earned_msat.ptr, skimmed_fee_msat.ptr, claim_from_onchain_tx, outbound_amount_forwarded_msat.ptr); Reference.reachabilityFence(prev_channel_id); Reference.reachabilityFence(next_channel_id); Reference.reachabilityFence(prev_user_channel_id); Reference.reachabilityFence(next_user_channel_id); + Reference.reachabilityFence(prev_node_id); + Reference.reachabilityFence(next_node_id); Reference.reachabilityFence(total_fee_earned_msat); Reference.reachabilityFence(skimmed_fee_msat); Reference.reachabilityFence(claim_from_onchain_tx); @@ -1880,14 +1955,15 @@ public class Event extends CommonBase { /** * Utility method to constructs a new ChannelClosed-variant Event */ - public static Event channel_closed(org.ldk.structs.ChannelId channel_id, org.ldk.util.UInt128 user_channel_id, org.ldk.structs.ClosureReason reason, byte[] counterparty_node_id, org.ldk.structs.Option_u64Z channel_capacity_sats, org.ldk.structs.OutPoint channel_funding_txo) { - long ret = bindings.Event_channel_closed(channel_id.ptr, user_channel_id.getLEBytes(), reason.ptr, InternalUtils.check_arr_len(counterparty_node_id, 33), channel_capacity_sats.ptr, channel_funding_txo.ptr); + public static Event channel_closed(org.ldk.structs.ChannelId channel_id, org.ldk.util.UInt128 user_channel_id, org.ldk.structs.ClosureReason reason, byte[] counterparty_node_id, org.ldk.structs.Option_u64Z channel_capacity_sats, org.ldk.structs.OutPoint channel_funding_txo, org.ldk.structs.Option_u64Z last_local_balance_msat) { + long ret = bindings.Event_channel_closed(channel_id.ptr, user_channel_id.getLEBytes(), reason.ptr, InternalUtils.check_arr_len(counterparty_node_id, 33), channel_capacity_sats.ptr, channel_funding_txo.ptr, last_local_balance_msat.ptr); Reference.reachabilityFence(channel_id); Reference.reachabilityFence(user_channel_id); Reference.reachabilityFence(reason); Reference.reachabilityFence(counterparty_node_id); Reference.reachabilityFence(channel_capacity_sats); Reference.reachabilityFence(channel_funding_txo); + Reference.reachabilityFence(last_local_balance_msat); 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); }; @@ -1910,12 +1986,12 @@ public class Event extends CommonBase { /** * 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, 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); + public static Event open_channel_request(org.ldk.structs.ChannelId temporary_channel_id, byte[] counterparty_node_id, long funding_satoshis, org.ldk.structs.InboundChannelFunds channel_negotiation_type, 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, channel_negotiation_type.ptr, 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_negotiation_type); Reference.reachabilityFence(channel_type); Reference.reachabilityFence(is_announced); Reference.reachabilityFence(params); diff --git a/src/main/java/org/ldk/structs/ExpandedKey.java b/src/main/java/org/ldk/structs/ExpandedKey.java index 55979067..a6fd71eb 100644 --- a/src/main/java/org/ldk/structs/ExpandedKey.java +++ b/src/main/java/org/ldk/structs/ExpandedKey.java @@ -9,10 +9,9 @@ import javax.annotation.Nullable; /** - * A set of keys that were HKDF-expanded from an initial call to - * [`NodeSigner::get_inbound_payment_key_material`]. + * A set of keys that were HKDF-expanded. Returned by [`NodeSigner::get_inbound_payment_key`]. * - * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material + * [`NodeSigner::get_inbound_payment_key`]: crate::sign::NodeSigner::get_inbound_payment_key */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ExpandedKey extends CommonBase { @@ -23,6 +22,53 @@ public class ExpandedKey extends CommonBase { if (ptr != 0) { bindings.ExpandedKey_free(ptr); } } + /** + * Generates a non-cryptographic 64-bit hash of the ExpandedKey. + */ + public long hash() { + long ret = bindings.ExpandedKey_hash(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + @Override public int hashCode() { + return (int)this.hash(); + } + long clone_ptr() { + long ret = bindings.ExpandedKey_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the ExpandedKey + */ + public ExpandedKey clone() { + long ret = bindings.ExpandedKey_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ExpandedKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ExpandedKey(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Checks if two ExpandedKeys 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.ExpandedKey b) { + boolean ret = bindings.ExpandedKey_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 ExpandedKey)) return false; + return this.eq((ExpandedKey)o); + } /** * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret. * diff --git a/src/main/java/org/ldk/structs/FilesystemStore.java b/src/main/java/org/ldk/structs/FilesystemStore.java index 898f7907..968aa611 100644 --- a/src/main/java/org/ldk/structs/FilesystemStore.java +++ b/src/main/java/org/ldk/structs/FilesystemStore.java @@ -54,4 +54,17 @@ public class FilesystemStore extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new MigratableKVStore which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned MigratableKVStore must be freed before this_arg is + */ + public MigratableKVStore as_MigratableKVStore() { + long ret = bindings.FilesystemStore_as_MigratableKVStore(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + MigratableKVStore ret_hu_conv = new MigratableKVStore(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/FinalOnionHopData.java b/src/main/java/org/ldk/structs/FinalOnionHopData.java index 96cf3e02..286ffe9c 100644 --- a/src/main/java/org/ldk/structs/FinalOnionHopData.java +++ b/src/main/java/org/ldk/structs/FinalOnionHopData.java @@ -96,6 +96,23 @@ public class FinalOnionHopData extends CommonBase { return ret_hu_conv; } + /** + * Checks if two FinalOnionHopDatas 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.FinalOnionHopData b) { + boolean ret = bindings.FinalOnionHopData_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 FinalOnionHopData)) return false; + return this.eq((FinalOnionHopData)o); + } /** * Serialize the FinalOnionHopData object into a byte array which can be read by FinalOnionHopData_read */ diff --git a/src/main/java/org/ldk/structs/FutureCallback.java b/src/main/java/org/ldk/structs/FutureCallback.java index fc5e6796..7a2311b8 100644 --- a/src/main/java/org/ldk/structs/FutureCallback.java +++ b/src/main/java/org/ldk/structs/FutureCallback.java @@ -11,11 +11,10 @@ import javax.annotation.Nullable; * A callback which is called when a [`Future`] completes. * * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be - * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`] - * instead. + * taken later. + * Rust users should use the [`std::future::Future`] implementation for [`Future`] instead. * - * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule - * futures when they receive a wake, rather than immediately executing them. + * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule futures when they receive a wake, rather than immediately executing them. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class FutureCallback extends CommonBase { diff --git a/src/main/java/org/ldk/structs/HeldHtlcAvailable.java b/src/main/java/org/ldk/structs/HeldHtlcAvailable.java index 19200562..294584c8 100644 --- a/src/main/java/org/ldk/structs/HeldHtlcAvailable.java +++ b/src/main/java/org/ldk/structs/HeldHtlcAvailable.java @@ -22,30 +22,11 @@ public class HeldHtlcAvailable extends CommonBase { 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); + public static HeldHtlcAvailable of() { + long ret = bindings.HeldHtlcAvailable_new(); 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); }; diff --git a/src/main/java/org/ldk/structs/HumanReadableName.java b/src/main/java/org/ldk/structs/HumanReadableName.java new file mode 100644 index 00000000..e90a978d --- /dev/null +++ b/src/main/java/org/ldk/structs/HumanReadableName.java @@ -0,0 +1,143 @@ +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 struct containing the two parts of a BIP 353 Human Readable Name - the user and domain parts. + * + * The `user` and `domain` parts, together, cannot exceed 232 bytes in length, and both must be + * non-empty. + * + * To protect against [Homograph Attacks], both parts of a Human Readable Name must be plain + * ASCII. + * + * [Homograph Attacks]: https://en.wikipedia.org/wiki/IDN_homograph_attack + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class HumanReadableName extends CommonBase { + HumanReadableName(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.HumanReadableName_free(ptr); } + } + + long clone_ptr() { + long ret = bindings.HumanReadableName_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the HumanReadableName + */ + public HumanReadableName clone() { + long ret = bindings.HumanReadableName_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.HumanReadableName ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HumanReadableName(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 HumanReadableName. + */ + public long hash() { + long ret = bindings.HumanReadableName_hash(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + @Override public int hashCode() { + return (int)this.hash(); + } + /** + * Checks if two HumanReadableNames 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.HumanReadableName b) { + boolean ret = bindings.HumanReadableName_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 HumanReadableName)) return false; + return this.eq((HumanReadableName)o); + } + /** + * Constructs a new [`HumanReadableName`] from the `user` and `domain` parts. See the + * struct-level documentation for more on the requirements on each. + */ + public static Result_HumanReadableNameNoneZ of(java.lang.String user, java.lang.String domain) { + long ret = bindings.HumanReadableName_new(user, domain); + Reference.reachabilityFence(user); + Reference.reachabilityFence(domain); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HumanReadableNameNoneZ ret_hu_conv = Result_HumanReadableNameNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Constructs a new [`HumanReadableName`] from the standard encoding - `user`@`domain`. + * + * If `user` includes the standard BIP 353 ₿ prefix it is automatically removed as required by + * BIP 353. + */ + public static Result_HumanReadableNameNoneZ from_encoded(java.lang.String encoded) { + long ret = bindings.HumanReadableName_from_encoded(encoded); + Reference.reachabilityFence(encoded); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HumanReadableNameNoneZ ret_hu_conv = Result_HumanReadableNameNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Gets the `user` part of this Human Readable Name + */ + public String user() { + String ret = bindings.HumanReadableName_user(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Gets the `domain` part of this Human Readable Name + */ + public String domain() { + String ret = bindings.HumanReadableName_domain(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Serialize the HumanReadableName object into a byte array which can be read by HumanReadableName_read + */ + public byte[] write() { + byte[] ret = bindings.HumanReadableName_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a HumanReadableName from a byte array, created by HumanReadableName_write + */ + public static Result_HumanReadableNameDecodeErrorZ read(byte[] ser) { + long ret = bindings.HumanReadableName_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HumanReadableNameDecodeErrorZ ret_hu_conv = Result_HumanReadableNameDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/IgnoringMessageHandler.java b/src/main/java/org/ldk/structs/IgnoringMessageHandler.java index dafad191..82f99df3 100644 --- a/src/main/java/org/ldk/structs/IgnoringMessageHandler.java +++ b/src/main/java/org/ldk/structs/IgnoringMessageHandler.java @@ -97,6 +97,19 @@ public class IgnoringMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new DNSResolverMessageHandler which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned DNSResolverMessageHandler must be freed before this_arg is + */ + public DNSResolverMessageHandler as_DNSResolverMessageHandler() { + long ret = bindings.IgnoringMessageHandler_as_DNSResolverMessageHandler(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + DNSResolverMessageHandler ret_hu_conv = new DNSResolverMessageHandler(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/InboundChannelFunds.java b/src/main/java/org/ldk/structs/InboundChannelFunds.java new file mode 100644 index 00000000..55d173cb --- /dev/null +++ b/src/main/java/org/ldk/structs/InboundChannelFunds.java @@ -0,0 +1,112 @@ +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; + + +/** + * Used to indicate the kind of funding for this channel by the channel acceptor (us). + * + * Allows the differentiation between a request for a dual-funded and non-dual-funded channel. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class InboundChannelFunds extends CommonBase { + private InboundChannelFunds(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.InboundChannelFunds_free(ptr); } + } + static InboundChannelFunds constr_from_ptr(long ptr) { + bindings.LDKInboundChannelFunds raw_val = bindings.LDKInboundChannelFunds_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKInboundChannelFunds.PushMsat.class) { + return new PushMsat(ptr, (bindings.LDKInboundChannelFunds.PushMsat)raw_val); + } + if (raw_val.getClass() == bindings.LDKInboundChannelFunds.DualFunded.class) { + return new DualFunded(ptr, (bindings.LDKInboundChannelFunds.DualFunded)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * For a non-dual-funded channel, the `push_msat` value from the channel initiator to us. + */ + public final static class PushMsat extends InboundChannelFunds { + public final long push_msat; + private PushMsat(long ptr, bindings.LDKInboundChannelFunds.PushMsat obj) { + super(null, ptr); + this.push_msat = obj.push_msat; + } + } + /** + * Indicates the open request is for a dual funded channel. + * + * Note that these channels do not support starting with initial funds pushed from the counterparty, + * who is the channel opener in this case. + */ + public final static class DualFunded extends InboundChannelFunds { + private DualFunded(long ptr, bindings.LDKInboundChannelFunds.DualFunded obj) { + super(null, ptr); + } + } + long clone_ptr() { + long ret = bindings.InboundChannelFunds_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the InboundChannelFunds + */ + public InboundChannelFunds clone() { + long ret = bindings.InboundChannelFunds_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InboundChannelFunds ret_hu_conv = org.ldk.structs.InboundChannelFunds.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 PushMsat-variant InboundChannelFunds + */ + public static InboundChannelFunds push_msat(long a) { + long ret = bindings.InboundChannelFunds_push_msat(a); + Reference.reachabilityFence(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InboundChannelFunds ret_hu_conv = org.ldk.structs.InboundChannelFunds.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 DualFunded-variant InboundChannelFunds + */ + public static InboundChannelFunds dual_funded() { + long ret = bindings.InboundChannelFunds_dual_funded(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InboundChannelFunds ret_hu_conv = org.ldk.structs.InboundChannelFunds.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 InboundChannelFundss contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public boolean eq(org.ldk.structs.InboundChannelFunds b) { + boolean ret = bindings.InboundChannelFunds_eq(this.ptr, b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof InboundChannelFunds)) return false; + return this.eq((InboundChannelFunds)o); + } +} diff --git a/src/main/java/org/ldk/structs/InitFeatures.java b/src/main/java/org/ldk/structs/InitFeatures.java index f49c6e88..d37dd2b2 100644 --- a/src/main/java/org/ldk/structs/InitFeatures.java +++ b/src/main/java/org/ldk/structs/InitFeatures.java @@ -726,6 +726,40 @@ public class InitFeatures extends CommonBase { return ret; } + /** + * Set this feature as optional. + */ + public void set_dual_fund_optional() { + bindings.InitFeatures_set_dual_fund_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_dual_fund_required() { + bindings.InitFeatures_set_dual_fund_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_dual_fund() { + boolean ret = bindings.InitFeatures_supports_dual_fund(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_dual_fund() { + boolean ret = bindings.InitFeatures_requires_dual_fund(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Set this feature as optional. */ diff --git a/src/main/java/org/ldk/structs/InvoiceRequest.java b/src/main/java/org/ldk/structs/InvoiceRequest.java index 5893b4bd..6ee48399 100644 --- a/src/main/java/org/ldk/structs/InvoiceRequest.java +++ b/src/main/java/org/ldk/structs/InvoiceRequest.java @@ -169,22 +169,32 @@ public class InvoiceRequest extends CommonBase { } /** - * The public key used by the recipient to sign invoices. + * The public key corresponding to the key used by the recipient to sign invoices. + * - If [`Offer::paths`] is empty, MUST be `Some` and contain the recipient's node id for + * sending an [`InvoiceRequest`]. + * - If [`Offer::paths`] is not empty, MAY be `Some` and contain a transient id. + * - If `None`, the signing pubkey will be the final blinded node id from the + * [`BlindedMessagePath`] in [`Offer::paths`] used to send the [`InvoiceRequest`]. + * + * See also [`Bolt12Invoice::signing_pubkey`]. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`Bolt12Invoice::signing_pubkey`]: crate::offers::invoice::Bolt12Invoice::signing_pubkey * * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ @Nullable - public byte[] signing_pubkey() { - byte[] ret = bindings.InvoiceRequest_signing_pubkey(this.ptr); + public byte[] issuer_signing_pubkey() { + byte[] ret = bindings.InvoiceRequest_issuer_signing_pubkey(this.ptr); Reference.reachabilityFence(this); return ret; } /** * An unpredictable series of bytes, typically containing information about the derivation of - * [`payer_id`]. + * [`payer_signing_pubkey`]. * - * [`payer_id`]: Self::payer_id + * [`payer_signing_pubkey`]: Self::payer_signing_pubkey */ public byte[] payer_metadata() { byte[] ret = bindings.InvoiceRequest_payer_metadata(this.ptr); @@ -216,6 +226,19 @@ public class InvoiceRequest extends CommonBase { return ret_hu_conv; } + /** + * Returns whether an amount was set in the request; otherwise, if [`amount_msats`] is `Some` + * then it was inferred from the [`Offer::amount`] and [`quantity`]. + * + * [`amount_msats`]: Self::amount_msats + * [`quantity`]: Self::quantity + */ + public boolean has_amount_msats() { + boolean ret = bindings.InvoiceRequest_has_amount_msats(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Features pertaining to requesting an invoice. */ @@ -243,8 +266,8 @@ public class InvoiceRequest extends CommonBase { /** * A possibly transient pubkey used to sign the invoice request. */ - public byte[] payer_id() { - byte[] ret = bindings.InvoiceRequest_payer_id(this.ptr); + public byte[] payer_signing_pubkey() { + byte[] ret = bindings.InvoiceRequest_payer_signing_pubkey(this.ptr); Reference.reachabilityFence(this); return ret; } @@ -265,6 +288,22 @@ public class InvoiceRequest extends CommonBase { return ret_hu_conv; } + /** + * If the [`Offer`] was sourced from a BIP 353 Human Readable Name, this should be set by the + * builder to indicate the original [`HumanReadableName`] which was resolved. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable + public HumanReadableName offer_from_hrn() { + long ret = bindings.InvoiceRequest_offer_from_hrn(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.HumanReadableName ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HumanReadableName(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + /** * Creates an [`InvoiceBuilder`] for the request with the given required fields and using the * [`Duration`] since [`std::time::SystemTime::UNIX_EPOCH`] as the creation time. @@ -288,8 +327,8 @@ public class InvoiceRequest extends CommonBase { * Creates an [`InvoiceBuilder`] for the request with the given required fields. * * Unless [`InvoiceBuilder::relative_expiry`] is set, the invoice will expire two hours after - * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. Useful for `no-std` builds - * where [`std::time::SystemTime`] is not available. + * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. + * Useful for non-`std` builds where [`std::time::SystemTime`] is not available. * * The caller is expected to remember the preimage of `payment_hash` in order to claim a payment * for the invoice. @@ -297,7 +336,7 @@ public class InvoiceRequest extends CommonBase { * The `payment_paths` parameter is useful for maintaining the payment recipient's privacy. It * must contain one or more elements ordered from most-preferred to least-preferred, if there's * a preference. Note, however, that any privacy is lost if a public node id was used for - * [`Offer::signing_pubkey`]. + * [`Offer::issuer_signing_pubkey`]. * * Errors if the request contains unknown required features. * @@ -364,9 +403,9 @@ public class InvoiceRequest extends CommonBase { } /** - * Signature of the invoice request using [`payer_id`]. + * Signature of the invoice request using [`payer_signing_pubkey`]. * - * [`payer_id`]: Self::payer_id + * [`payer_signing_pubkey`]: Self::payer_signing_pubkey */ public byte[] signature() { byte[] ret = bindings.InvoiceRequest_signature(this.ptr); @@ -383,4 +422,15 @@ public class InvoiceRequest extends CommonBase { return ret; } + /** + * Read a InvoiceRequest from a byte array, created by InvoiceRequest_write + */ + public static Result_InvoiceRequestDecodeErrorZ read(byte[] ser) { + long ret = bindings.InvoiceRequest_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestDecodeErrorZ ret_hu_conv = Result_InvoiceRequestDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/InvoiceRequestFields.java b/src/main/java/org/ldk/structs/InvoiceRequestFields.java index 2fc96ad7..136aac40 100644 --- a/src/main/java/org/ldk/structs/InvoiceRequestFields.java +++ b/src/main/java/org/ldk/structs/InvoiceRequestFields.java @@ -25,8 +25,8 @@ public class InvoiceRequestFields extends CommonBase { /** * A possibly transient pubkey used to sign the invoice request. */ - public byte[] get_payer_id() { - byte[] ret = bindings.InvoiceRequestFields_get_payer_id(this.ptr); + public byte[] get_payer_signing_pubkey() { + byte[] ret = bindings.InvoiceRequestFields_get_payer_signing_pubkey(this.ptr); Reference.reachabilityFence(this); return ret; } @@ -34,8 +34,8 @@ public class InvoiceRequestFields extends CommonBase { /** * A possibly transient pubkey used to sign the invoice request. */ - public void set_payer_id(byte[] val) { - bindings.InvoiceRequestFields_set_payer_id(this.ptr, InternalUtils.check_arr_len(val, 33)); + public void set_payer_signing_pubkey(byte[] val) { + bindings.InvoiceRequestFields_set_payer_signing_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } @@ -89,16 +89,44 @@ public class InvoiceRequestFields extends CommonBase { Reference.reachabilityFence(val); } + /** + * The Human Readable Name which the sender indicated they were paying to. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable + public HumanReadableName get_human_readable_name() { + long ret = bindings.InvoiceRequestFields_get_human_readable_name(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.HumanReadableName ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HumanReadableName(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * The Human Readable Name which the sender indicated they were paying to. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void set_human_readable_name(@Nullable org.ldk.structs.HumanReadableName val) { + bindings.InvoiceRequestFields_set_human_readable_name(this.ptr, val == null ? 0 : val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + /** * Constructs a new InvoiceRequestFields given each field * * Note that payer_note_truncated_arg (or a relevant inner pointer) may be NULL or all-0s to represent None + * Note that human_readable_name_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static InvoiceRequestFields of(byte[] payer_id_arg, org.ldk.structs.Option_u64Z quantity_arg, @Nullable org.ldk.structs.UntrustedString payer_note_truncated_arg) { - long ret = bindings.InvoiceRequestFields_new(InternalUtils.check_arr_len(payer_id_arg, 33), quantity_arg.ptr, payer_note_truncated_arg == null ? 0 : payer_note_truncated_arg.ptr); - Reference.reachabilityFence(payer_id_arg); + public static InvoiceRequestFields of(byte[] payer_signing_pubkey_arg, org.ldk.structs.Option_u64Z quantity_arg, @Nullable org.ldk.structs.UntrustedString payer_note_truncated_arg, @Nullable org.ldk.structs.HumanReadableName human_readable_name_arg) { + long ret = bindings.InvoiceRequestFields_new(InternalUtils.check_arr_len(payer_signing_pubkey_arg, 33), quantity_arg.ptr, payer_note_truncated_arg == null ? 0 : payer_note_truncated_arg.ptr, human_readable_name_arg == null ? 0 : human_readable_name_arg.ptr); + Reference.reachabilityFence(payer_signing_pubkey_arg); Reference.reachabilityFence(quantity_arg); Reference.reachabilityFence(payer_note_truncated_arg); + Reference.reachabilityFence(human_readable_name_arg); 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); }; diff --git a/src/main/java/org/ldk/structs/InvoiceRequestWithDerivedPayerIdBuilder.java b/src/main/java/org/ldk/structs/InvoiceRequestWithDerivedPayerSigningPubkeyBuilder.java similarity index 77% rename from src/main/java/org/ldk/structs/InvoiceRequestWithDerivedPayerIdBuilder.java rename to src/main/java/org/ldk/structs/InvoiceRequestWithDerivedPayerSigningPubkeyBuilder.java index 4ac13bdd..2835290c 100644 --- a/src/main/java/org/ldk/structs/InvoiceRequestWithDerivedPayerIdBuilder.java +++ b/src/main/java/org/ldk/structs/InvoiceRequestWithDerivedPayerSigningPubkeyBuilder.java @@ -16,19 +16,19 @@ import javax.annotation.Nullable; * [module-level documentation]: self */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class InvoiceRequestWithDerivedPayerIdBuilder extends CommonBase { - InvoiceRequestWithDerivedPayerIdBuilder(Object _dummy, long ptr) { super(ptr); } +public class InvoiceRequestWithDerivedPayerSigningPubkeyBuilder extends CommonBase { + InvoiceRequestWithDerivedPayerSigningPubkeyBuilder(Object _dummy, long ptr) { super(ptr); } @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { super.finalize(); - if (ptr != 0) { bindings.InvoiceRequestWithDerivedPayerIdBuilder_free(ptr); } + if (ptr != 0) { bindings.InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_free(ptr); } } /** * Builds a signed [`InvoiceRequest`] after checking for valid semantics. */ public Result_InvoiceRequestBolt12SemanticErrorZ build_and_sign() { - long ret = bindings.InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(this.ptr); + long ret = bindings.InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_build_and_sign(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } Result_InvoiceRequestBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestBolt12SemanticErrorZ.constr_from_ptr(ret); @@ -52,7 +52,7 @@ public class InvoiceRequestWithDerivedPayerIdBuilder extends CommonBase { * Successive calls to this method will override the previous setting. */ public Result_NoneBolt12SemanticErrorZ chain(org.ldk.enums.Network network) { - long ret = bindings.InvoiceRequestWithDerivedPayerIdBuilder_chain(this.ptr, network); + long ret = bindings.InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_chain(this.ptr, network); Reference.reachabilityFence(this); Reference.reachabilityFence(network); if (ret >= 0 && ret <= 4096) { return null; } @@ -78,7 +78,7 @@ public class InvoiceRequestWithDerivedPayerIdBuilder extends CommonBase { * [`quantity`]: Self::quantity */ public Result_NoneBolt12SemanticErrorZ amount_msats(long amount_msats) { - long ret = bindings.InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(this.ptr, amount_msats); + long ret = bindings.InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_amount_msats(this.ptr, amount_msats); Reference.reachabilityFence(this); Reference.reachabilityFence(amount_msats); if (ret >= 0 && ret <= 4096) { return null; } @@ -102,7 +102,7 @@ public class InvoiceRequestWithDerivedPayerIdBuilder extends CommonBase { * Successive calls to this method will override the previous setting. */ public Result_NoneBolt12SemanticErrorZ quantity(long quantity) { - long ret = bindings.InvoiceRequestWithDerivedPayerIdBuilder_quantity(this.ptr, quantity); + long ret = bindings.InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_quantity(this.ptr, quantity); Reference.reachabilityFence(this); Reference.reachabilityFence(quantity); if (ret >= 0 && ret <= 4096) { return null; } @@ -125,7 +125,7 @@ public class InvoiceRequestWithDerivedPayerIdBuilder extends CommonBase { * Successive calls to this method will override the previous setting. */ public void payer_note(java.lang.String payer_note) { - bindings.InvoiceRequestWithDerivedPayerIdBuilder_payer_note(this.ptr, payer_note); + bindings.InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_payer_note(this.ptr, payer_note); Reference.reachabilityFence(this); Reference.reachabilityFence(payer_note); if (this != null) { this.ptrs_to.add(this); }; @@ -139,4 +139,24 @@ public class InvoiceRequestWithDerivedPayerIdBuilder extends CommonBase { this.ptr = 0;; } + /** + * Sets the [`InvoiceRequest::offer_from_hrn`]. + * + * Successive calls to this method will override the previous setting. + */ + public void sourced_from_human_readable_name(org.ldk.structs.HumanReadableName hrn) { + bindings.InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_sourced_from_human_readable_name(this.ptr, hrn.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(hrn); + if (this != null) { this.ptrs_to.add(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + } + } diff --git a/src/main/java/org/ldk/structs/InvoiceRequestWithExplicitPayerIdBuilder.java b/src/main/java/org/ldk/structs/InvoiceRequestWithExplicitPayerIdBuilder.java deleted file mode 100644 index 974301c4..00000000 --- a/src/main/java/org/ldk/structs/InvoiceRequestWithExplicitPayerIdBuilder.java +++ /dev/null @@ -1,143 +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; - - -/** - * Builds an [`InvoiceRequest`] from an [`Offer`] for the \"offer to be paid\" flow. - * - * See [module-level documentation] for usage. - * - * [module-level documentation]: self - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class InvoiceRequestWithExplicitPayerIdBuilder extends CommonBase { - InvoiceRequestWithExplicitPayerIdBuilder(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.InvoiceRequestWithExplicitPayerIdBuilder_free(ptr); } - } - - /** - * Builds an unsigned [`InvoiceRequest`] after checking for valid semantics. It can be signed - * by [`UnsignedInvoiceRequest::sign`]. - */ - public Result_UnsignedInvoiceRequestBolt12SemanticErrorZ build() { - long ret = bindings.InvoiceRequestWithExplicitPayerIdBuilder_build(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_UnsignedInvoiceRequestBolt12SemanticErrorZ ret_hu_conv = Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(this); }; - // Due to rust's strict-ownership memory model, in some cases we need to "move" - // an object to pass exclusive ownership to the function being called. - // In most cases, we avoid this being visible in GC'd languages by cloning the object - // at the FFI layer, creating a new object which Rust can claim ownership of - // However, in some cases (eg here), there is no way to clone an object, and thus - // we actually have to pass full ownership to Rust. - // Thus, after this call, this is reset to null and is now a dummy object. - this.ptr = 0;; - return ret_hu_conv; - } - - /** - * Sets the [`InvoiceRequest::chain`] of the given [`Network`] for paying an invoice. If not - * called, [`Network::Bitcoin`] is assumed. Errors if the chain for `network` is not supported - * by the offer. - * - * Successive calls to this method will override the previous setting. - */ - public Result_NoneBolt12SemanticErrorZ chain(org.ldk.enums.Network network) { - long ret = bindings.InvoiceRequestWithExplicitPayerIdBuilder_chain(this.ptr, network); - Reference.reachabilityFence(this); - Reference.reachabilityFence(network); - 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); }; - // Due to rust's strict-ownership memory model, in some cases we need to "move" - // an object to pass exclusive ownership to the function being called. - // In most cases, we avoid this being visible in GC'd languages by cloning the object - // at the FFI layer, creating a new object which Rust can claim ownership of - // However, in some cases (eg here), there is no way to clone an object, and thus - // we actually have to pass full ownership to Rust. - // Thus, after this call, this is reset to null and is now a dummy object. - this.ptr = 0;; - return ret_hu_conv; - } - - /** - * Sets the [`InvoiceRequest::amount_msats`] for paying an invoice. Errors if `amount_msats` is - * not at least the expected invoice amount (i.e., [`Offer::amount`] times [`quantity`]). - * - * Successive calls to this method will override the previous setting. - * - * [`quantity`]: Self::quantity - */ - public Result_NoneBolt12SemanticErrorZ amount_msats(long amount_msats) { - long ret = bindings.InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(this.ptr, amount_msats); - Reference.reachabilityFence(this); - Reference.reachabilityFence(amount_msats); - 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); }; - // Due to rust's strict-ownership memory model, in some cases we need to "move" - // an object to pass exclusive ownership to the function being called. - // In most cases, we avoid this being visible in GC'd languages by cloning the object - // at the FFI layer, creating a new object which Rust can claim ownership of - // However, in some cases (eg here), there is no way to clone an object, and thus - // we actually have to pass full ownership to Rust. - // Thus, after this call, this is reset to null and is now a dummy object. - this.ptr = 0;; - return ret_hu_conv; - } - - /** - * Sets [`InvoiceRequest::quantity`] of items. If not set, `1` is assumed. Errors if `quantity` - * does not conform to [`Offer::is_valid_quantity`]. - * - * Successive calls to this method will override the previous setting. - */ - public Result_NoneBolt12SemanticErrorZ quantity(long quantity) { - long ret = bindings.InvoiceRequestWithExplicitPayerIdBuilder_quantity(this.ptr, quantity); - Reference.reachabilityFence(this); - Reference.reachabilityFence(quantity); - 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); }; - // Due to rust's strict-ownership memory model, in some cases we need to "move" - // an object to pass exclusive ownership to the function being called. - // In most cases, we avoid this being visible in GC'd languages by cloning the object - // at the FFI layer, creating a new object which Rust can claim ownership of - // However, in some cases (eg here), there is no way to clone an object, and thus - // we actually have to pass full ownership to Rust. - // Thus, after this call, this is reset to null and is now a dummy object. - this.ptr = 0;; - return ret_hu_conv; - } - - /** - * Sets the [`InvoiceRequest::payer_note`]. - * - * Successive calls to this method will override the previous setting. - */ - public void payer_note(java.lang.String payer_note) { - bindings.InvoiceRequestWithExplicitPayerIdBuilder_payer_note(this.ptr, payer_note); - Reference.reachabilityFence(this); - Reference.reachabilityFence(payer_note); - if (this != null) { this.ptrs_to.add(this); }; - // Due to rust's strict-ownership memory model, in some cases we need to "move" - // an object to pass exclusive ownership to the function being called. - // In most cases, we avoid this being visible in GC'd languages by cloning the object - // at the FFI layer, creating a new object which Rust can claim ownership of - // However, in some cases (eg here), there is no way to clone an object, and thus - // we actually have to pass full ownership to Rust. - // Thus, after this call, this is reset to null and is now a dummy object. - this.ptr = 0;; - } - -} diff --git a/src/main/java/org/ldk/structs/InvoiceWithExplicitSigningPubkeyBuilder.java b/src/main/java/org/ldk/structs/InvoiceWithExplicitSigningPubkeyBuilder.java index c0a612fd..7517bfb5 100644 --- a/src/main/java/org/ldk/structs/InvoiceWithExplicitSigningPubkeyBuilder.java +++ b/src/main/java/org/ldk/structs/InvoiceWithExplicitSigningPubkeyBuilder.java @@ -29,8 +29,7 @@ public class InvoiceWithExplicitSigningPubkeyBuilder extends CommonBase { } /** - * Builds an unsigned [`Bolt12Invoice`] after checking for valid semantics. It can be signed by - * [`UnsignedBolt12Invoice::sign`]. + * Builds an unsigned [`Bolt12Invoice`] after checking for valid semantics. */ public Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ build() { long ret = bindings.InvoiceWithExplicitSigningPubkeyBuilder_build(this.ptr); diff --git a/src/main/java/org/ldk/structs/MessageContext.java b/src/main/java/org/ldk/structs/MessageContext.java index 3b9d5c35..65f7f1e8 100644 --- a/src/main/java/org/ldk/structs/MessageContext.java +++ b/src/main/java/org/ldk/structs/MessageContext.java @@ -28,6 +28,12 @@ public class MessageContext extends CommonBase { if (raw_val.getClass() == bindings.LDKMessageContext.Offers.class) { return new Offers(ptr, (bindings.LDKMessageContext.Offers)raw_val); } + if (raw_val.getClass() == bindings.LDKMessageContext.AsyncPayments.class) { + return new AsyncPayments(ptr, (bindings.LDKMessageContext.AsyncPayments)raw_val); + } + if (raw_val.getClass() == bindings.LDKMessageContext.DNSResolver.class) { + return new DNSResolver(ptr, (bindings.LDKMessageContext.DNSResolver)raw_val); + } if (raw_val.getClass() == bindings.LDKMessageContext.Custom.class) { return new Custom(ptr, (bindings.LDKMessageContext.Custom)raw_val); } @@ -49,6 +55,37 @@ public class MessageContext extends CommonBase { this.offers = offers_hu_conv; } } + /** + * Context specific to an [`AsyncPaymentsMessage`]. + * + * [`AsyncPaymentsMessage`]: crate::onion_message::async_payments::AsyncPaymentsMessage + */ + public final static class AsyncPayments extends MessageContext { + public final org.ldk.structs.AsyncPaymentsContext async_payments; + private AsyncPayments(long ptr, bindings.LDKMessageContext.AsyncPayments obj) { + super(null, ptr); + long async_payments = obj.async_payments; + org.ldk.structs.AsyncPaymentsContext async_payments_hu_conv = org.ldk.structs.AsyncPaymentsContext.constr_from_ptr(async_payments); + if (async_payments_hu_conv != null) { async_payments_hu_conv.ptrs_to.add(this); }; + this.async_payments = async_payments_hu_conv; + } + } + /** + * Represents a context for a blinded path used in a reply path when requesting a DNSSEC proof + * in a [`DNSResolverMessage`]. + * + * [`DNSResolverMessage`]: crate::onion_message::dns_resolution::DNSResolverMessage + */ + public final static class DNSResolver extends MessageContext { + public final org.ldk.structs.DNSResolverContext dns_resolver; + private DNSResolver(long ptr, bindings.LDKMessageContext.DNSResolver obj) { + super(null, ptr); + long dns_resolver = obj.dns_resolver; + org.ldk.structs.DNSResolverContext dns_resolver_hu_conv = null; if (dns_resolver < 0 || dns_resolver > 4096) { dns_resolver_hu_conv = new org.ldk.structs.DNSResolverContext(null, dns_resolver); } + if (dns_resolver_hu_conv != null) { dns_resolver_hu_conv.ptrs_to.add(this); }; + this.dns_resolver = dns_resolver_hu_conv; + } + } /** * Context specific to a [`CustomOnionMessageHandler::CustomMessage`]. * @@ -91,6 +128,30 @@ public class MessageContext extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new AsyncPayments-variant MessageContext + */ + public static MessageContext async_payments(org.ldk.structs.AsyncPaymentsContext a) { + long ret = bindings.MessageContext_async_payments(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 DNSResolver-variant MessageContext + */ + public static MessageContext dnsresolver(org.ldk.structs.DNSResolverContext a) { + long ret = bindings.MessageContext_dnsresolver(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 */ diff --git a/src/main/java/org/ldk/structs/MigratableKVStore.java b/src/main/java/org/ldk/structs/MigratableKVStore.java new file mode 100644 index 00000000..7645c37a --- /dev/null +++ b/src/main/java/org/ldk/structs/MigratableKVStore.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; + +/** + * Provides additional interface methods that are required for [`KVStore`]-to-[`KVStore`] + * data migration. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class MigratableKVStore extends CommonBase { + final bindings.LDKMigratableKVStore bindings_instance; + MigratableKVStore(Object _dummy, long ptr) { super(ptr); bindings_instance = null; } + private MigratableKVStore(bindings.LDKMigratableKVStore arg, bindings.LDKKVStore KVStore) { + super(bindings.LDKMigratableKVStore_new(arg, KVStore)); + this.ptrs_to.add(arg); + this.ptrs_to.add(KVStore); + this.bindings_instance = arg; + } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.MigratableKVStore_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.MigratableKVStore_free(ptr); } + ptr = 0; + } + public static interface MigratableKVStoreInterface { + /** + * Returns *all* known keys as a list of `primary_namespace`, `secondary_namespace`, `key` tuples. + * + * This is useful for migrating data from [`KVStore`] implementation to [`KVStore`] + * implementation. + * + * Must exhaustively return all entries known to the store to ensure no data is missed, but + * may return the items in arbitrary order. + */ + Result_CVec_C3Tuple_StrStrStrZZIOErrorZ list_all_keys(); + } + private static class LDKMigratableKVStoreHolder { MigratableKVStore held; } + public static MigratableKVStore new_impl(MigratableKVStoreInterface arg, KVStore.KVStoreInterface KVStore_impl) { + final LDKMigratableKVStoreHolder impl_holder = new LDKMigratableKVStoreHolder(); + impl_holder.held = new MigratableKVStore(new bindings.LDKMigratableKVStore() { + @Override public long list_all_keys() { + Result_CVec_C3Tuple_StrStrStrZZIOErrorZ ret = arg.list_all_keys(); + Reference.reachabilityFence(arg); + long result = ret.clone_ptr(); + return result; + } + }, KVStore.new_impl(KVStore_impl).bindings_instance); + return impl_holder.held; + } + + /** + * Gets the underlying KVStore. + */ + public KVStore get_k_v_store() { + KVStore res = new KVStore(null, bindings.LDKMigratableKVStore_get_KVStore(this.ptr)); + res.ptrs_to.add(this); + return res; + } + + /** + * Returns *all* known keys as a list of `primary_namespace`, `secondary_namespace`, `key` tuples. + * + * This is useful for migrating data from [`KVStore`] implementation to [`KVStore`] + * implementation. + * + * Must exhaustively return all entries known to the store to ensure no data is missed, but + * may return the items in arbitrary order. + */ + public Result_CVec_C3Tuple_StrStrStrZZIOErrorZ list_all_keys() { + long ret = bindings.MigratableKVStore_list_all_keys(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_C3Tuple_StrStrStrZZIOErrorZ ret_hu_conv = Result_CVec_C3Tuple_StrStrStrZZIOErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/MonitorName.java b/src/main/java/org/ldk/structs/MonitorName.java new file mode 100644 index 00000000..41fe41f4 --- /dev/null +++ b/src/main/java/org/ldk/structs/MonitorName.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 struct representing a name for a channel monitor. + * + * `MonitorName` is primarily used within the [`MonitorUpdatingPersister`] + * in functions that store or retrieve channel monitor snapshots. + * It provides a consistent way to generate a unique key for channel + * monitors based on their funding outpoints. + * + * While users of the Lightning Dev Kit library generally won't need + * to interact with [`MonitorName`] directly, it can be useful for: + * - Custom persistence implementations + * - Debugging or logging channel monitor operations + * - Extending the functionality of the `MonitorUpdatingPersister` + * # Examples + * + * ``` + * use std::str::FromStr; + * + * use bitcoin::Txid; + * + * use lightning::util::persist::MonitorName; + * use lightning::chain::transaction::OutPoint; + * + * let outpoint = OutPoint { + * \t txid: Txid::from_str(\"deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef\").unwrap(), + * \t index: 1, + * }; + * let monitor_name = MonitorName::from(outpoint); + * assert_eq!(monitor_name.as_str(), \"deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1\"); + * + * Using MonitorName to generate a storage key + * let storage_key = format!(\"channel_monitors/{}\", monitor_name.as_str()); + * ``` + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class MonitorName extends CommonBase { + MonitorName(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.MonitorName_free(ptr); } + } + + /** + * Constructs a [`MonitorName`], after verifying that an [`OutPoint`] can + * be formed from the given `name`. + * This method is useful if you have a String and you want to verify that + * it's a valid storage key for a channel monitor. + */ + public static Result_MonitorNameIOErrorZ of(java.lang.String name) { + long ret = bindings.MonitorName_new(name); + Reference.reachabilityFence(name); + if (ret >= 0 && ret <= 4096) { return null; } + Result_MonitorNameIOErrorZ ret_hu_conv = Result_MonitorNameIOErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Convert this monitor name to a str. + * This method is particularly useful when you need to use the monitor name + * as a key in a key-value store or when logging. + */ + public String as_str() { + String ret = bindings.MonitorName_as_str(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + +} diff --git a/src/main/java/org/ldk/structs/NetworkGraph.java b/src/main/java/org/ldk/structs/NetworkGraph.java index c9f86046..68b10f9c 100644 --- a/src/main/java/org/ldk/structs/NetworkGraph.java +++ b/src/main/java/org/ldk/structs/NetworkGraph.java @@ -273,7 +273,7 @@ public class NetworkGraph extends CommonBase { * in the map for a while so that these can be resynced from gossip in the future. * * This method is only available with the `std` feature. See - * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use. + * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for non-`std` use. */ public void remove_stale_channels_and_tracking() { bindings.NetworkGraph_remove_stale_channels_and_tracking(this.ptr); @@ -309,7 +309,7 @@ public class NetworkGraph extends CommonBase { * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept * routing messages from a source using a protocol other than the lightning P2P protocol. * - * If built with `no-std`, any updates with a timestamp more than two weeks in the past or + * If not built with `std`, any updates with a timestamp more than two weeks in the past or * materially in the future will be rejected. */ public Result_NoneLightningErrorZ update_channel(org.ldk.structs.ChannelUpdate msg) { @@ -327,7 +327,7 @@ public class NetworkGraph extends CommonBase { * of the channel without verifying the associated signatures. Because we aren't given the * associated signatures here we cannot relay the channel update to any of our peers. * - * If built with `no-std`, any updates with a timestamp more than two weeks in the past or + * If not built with `std`, any updates with a timestamp more than two weeks in the past or * materially in the future will be rejected. */ public Result_NoneLightningErrorZ update_channel_unsigned(org.ldk.structs.UnsignedChannelUpdate msg) { @@ -345,7 +345,7 @@ public class NetworkGraph extends CommonBase { * * This checks whether the update currently is applicable by [`Self::update_channel`]. * - * If built with `no-std`, any updates with a timestamp more than two weeks in the past or + * If not built with `std`, any updates with a timestamp more than two weeks in the past or * materially in the future will be rejected. */ public Result_NoneLightningErrorZ verify_channel_update(org.ldk.structs.ChannelUpdate msg) { diff --git a/src/main/java/org/ldk/structs/NodeFeatures.java b/src/main/java/org/ldk/structs/NodeFeatures.java index 9763da3c..d3c5f2fe 100644 --- a/src/main/java/org/ldk/structs/NodeFeatures.java +++ b/src/main/java/org/ldk/structs/NodeFeatures.java @@ -701,6 +701,40 @@ public class NodeFeatures extends CommonBase { return ret; } + /** + * Set this feature as optional. + */ + public void set_dual_fund_optional() { + bindings.NodeFeatures_set_dual_fund_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_dual_fund_required() { + bindings.NodeFeatures_set_dual_fund_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_dual_fund() { + boolean ret = bindings.NodeFeatures_supports_dual_fund(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_dual_fund() { + boolean ret = bindings.NodeFeatures_requires_dual_fund(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Set this feature as optional. */ @@ -939,4 +973,38 @@ public class NodeFeatures extends CommonBase { return ret; } + /** + * Set this feature as optional. + */ + public void set_dns_resolution_optional() { + bindings.NodeFeatures_set_dns_resolution_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_dns_resolution_required() { + bindings.NodeFeatures_set_dns_resolution_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_dns_resolution() { + boolean ret = bindings.NodeFeatures_supports_dns_resolution(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_dns_resolution() { + boolean ret = bindings.NodeFeatures_requires_dns_resolution(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + } diff --git a/src/main/java/org/ldk/structs/NodeSigner.java b/src/main/java/org/ldk/structs/NodeSigner.java index c82804d4..5f2a2b1a 100644 --- a/src/main/java/org/ldk/structs/NodeSigner.java +++ b/src/main/java/org/ldk/structs/NodeSigner.java @@ -38,7 +38,7 @@ public class NodeSigner extends CommonBase { } public static interface NodeSignerInterface { /** - * Get secret key material as bytes for use in encrypting and decrypting inbound payment data. + * Get the [`ExpandedKey`] for use in encrypting and decrypting inbound payment data. * * If the implementor of this trait supports [phantom node payments], then every node that is * intended to be included in the phantom invoice route hints must return the same value from @@ -48,7 +48,7 @@ public class NodeSigner extends CommonBase { * * [phantom node payments]: PhantomKeysManager */ - byte[] get_inbound_payment_key_material(); + ExpandedKey get_inbound_payment_key(); /** * Get node id based on the provided [`Recipient`]. * @@ -83,26 +83,9 @@ public class NodeSigner extends CommonBase { * Errors if the [`Recipient`] variant is not supported by the implementation. */ Result_RecoverableSignatureNoneZ sign_invoice(RawBolt11Invoice invoice, Recipient recipient); - /** - * Signs the [`TaggedHash`] of a BOLT 12 invoice request. - * - * May be called by a function passed to [`UnsignedInvoiceRequest::sign`] where - * `invoice_request` is the callee. - * - * Implementors may check that the `invoice_request` is expected rather than blindly signing - * the tagged hash. An `Ok` result should sign `invoice_request.tagged_hash().as_digest()` with - * the node's signing key or an ephemeral key to preserve privacy, whichever is associated with - * [`UnsignedInvoiceRequest::payer_id`]. - * - * [`TaggedHash`]: crate::offers::merkle::TaggedHash - */ - Result_SchnorrSignatureNoneZ sign_bolt12_invoice_request(UnsignedInvoiceRequest invoice_request); /** * Signs the [`TaggedHash`] of a BOLT 12 invoice. * - * May be called by a function passed to [`UnsignedBolt12Invoice::sign`] where `invoice` is the - * callee. - * * Implementors may check that the `invoice` is expected rather than blindly signing the tagged * hash. An `Ok` result should sign `invoice.tagged_hash().as_digest()` with the node's signing * key or an ephemeral key to preserve privacy, whichever is associated with @@ -125,10 +108,10 @@ public class NodeSigner extends CommonBase { public static NodeSigner new_impl(NodeSignerInterface arg) { final LDKNodeSignerHolder impl_holder = new LDKNodeSignerHolder(); impl_holder.held = new NodeSigner(new bindings.LDKNodeSigner() { - @Override public byte[] get_inbound_payment_key_material() { - byte[] ret = arg.get_inbound_payment_key_material(); + @Override public long get_inbound_payment_key() { + ExpandedKey ret = arg.get_inbound_payment_key(); Reference.reachabilityFence(arg); - byte[] result = InternalUtils.check_arr_len(ret, 32); + long result = ret.clone_ptr(); return result; } @Override public long get_node_id(Recipient recipient) { @@ -152,13 +135,6 @@ public class NodeSigner extends CommonBase { long result = ret.clone_ptr(); return result; } - @Override public long sign_bolt12_invoice_request(long invoice_request) { - org.ldk.structs.UnsignedInvoiceRequest invoice_request_hu_conv = null; if (invoice_request < 0 || invoice_request > 4096) { invoice_request_hu_conv = new org.ldk.structs.UnsignedInvoiceRequest(null, invoice_request); } - Result_SchnorrSignatureNoneZ ret = arg.sign_bolt12_invoice_request(invoice_request_hu_conv); - Reference.reachabilityFence(arg); - long result = ret.clone_ptr(); - return result; - } @Override public long sign_bolt12_invoice(long invoice) { org.ldk.structs.UnsignedBolt12Invoice invoice_hu_conv = null; if (invoice < 0 || invoice > 4096) { invoice_hu_conv = new org.ldk.structs.UnsignedBolt12Invoice(null, invoice); } Result_SchnorrSignatureNoneZ ret = arg.sign_bolt12_invoice(invoice_hu_conv); @@ -178,7 +154,7 @@ public class NodeSigner extends CommonBase { return impl_holder.held; } /** - * Get secret key material as bytes for use in encrypting and decrypting inbound payment data. + * Get the [`ExpandedKey`] for use in encrypting and decrypting inbound payment data. * * If the implementor of this trait supports [phantom node payments], then every node that is * intended to be included in the phantom invoice route hints must return the same value from @@ -188,10 +164,13 @@ public class NodeSigner extends CommonBase { * * [phantom node payments]: PhantomKeysManager */ - public byte[] get_inbound_payment_key_material() { - byte[] ret = bindings.NodeSigner_get_inbound_payment_key_material(this.ptr); + public ExpandedKey get_inbound_payment_key() { + long ret = bindings.NodeSigner_get_inbound_payment_key(this.ptr); Reference.reachabilityFence(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ExpandedKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ExpandedKey(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; } /** @@ -256,35 +235,9 @@ public class NodeSigner extends CommonBase { return ret_hu_conv; } - /** - * Signs the [`TaggedHash`] of a BOLT 12 invoice request. - * - * May be called by a function passed to [`UnsignedInvoiceRequest::sign`] where - * `invoice_request` is the callee. - * - * Implementors may check that the `invoice_request` is expected rather than blindly signing - * the tagged hash. An `Ok` result should sign `invoice_request.tagged_hash().as_digest()` with - * the node's signing key or an ephemeral key to preserve privacy, whichever is associated with - * [`UnsignedInvoiceRequest::payer_id`]. - * - * [`TaggedHash`]: crate::offers::merkle::TaggedHash - */ - public Result_SchnorrSignatureNoneZ sign_bolt12_invoice_request(org.ldk.structs.UnsignedInvoiceRequest invoice_request) { - long ret = bindings.NodeSigner_sign_bolt12_invoice_request(this.ptr, invoice_request.ptr); - Reference.reachabilityFence(this); - Reference.reachabilityFence(invoice_request); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SchnorrSignatureNoneZ ret_hu_conv = Result_SchnorrSignatureNoneZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(invoice_request); }; - return ret_hu_conv; - } - /** * Signs the [`TaggedHash`] of a BOLT 12 invoice. * - * May be called by a function passed to [`UnsignedBolt12Invoice::sign`] where `invoice` is the - * callee. - * * Implementors may check that the `invoice` is expected rather than blindly signing the tagged * hash. An `Ok` result should sign `invoice.tagged_hash().as_digest()` with the node's signing * key or an ephemeral key to preserve privacy, whichever is associated with diff --git a/src/main/java/org/ldk/structs/Nonce.java b/src/main/java/org/ldk/structs/Nonce.java index e5317517..94f0f2df 100644 --- a/src/main/java/org/ldk/structs/Nonce.java +++ b/src/main/java/org/ldk/structs/Nonce.java @@ -11,11 +11,11 @@ import javax.annotation.Nullable; /** * A 128-bit number used only once. * - * Needed when constructing [`Offer::metadata`] and deriving [`Offer::signing_pubkey`] from + * Needed when constructing [`Offer::metadata`] and deriving [`Offer::issuer_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 + * [`Offer::issuer_signing_pubkey`]: crate::offers::offer::Offer::issuer_signing_pubkey * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays diff --git a/src/main/java/org/ldk/structs/OMNameResolver.java b/src/main/java/org/ldk/structs/OMNameResolver.java new file mode 100644 index 00000000..df6b7bd0 --- /dev/null +++ b/src/main/java/org/ldk/structs/OMNameResolver.java @@ -0,0 +1,122 @@ +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 stateful resolver which maps BIP 353 Human Readable Names to URIs and BOLT12 [`Offer`]s. + * + * It does not directly implement [`DNSResolverMessageHandler`] but implements all the core logic + * which is required in a client which intends to. + * + * It relies on being made aware of the passage of time with regular calls to + * [`Self::new_best_block`] in order to time out existing queries. Queries time out after two + * blocks. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class OMNameResolver extends CommonBase { + OMNameResolver(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.OMNameResolver_free(ptr); } + } + + /** + * Builds a new [`OMNameResolver`]. + */ + public static OMNameResolver of(int latest_block_time, int latest_block_height) { + long ret = bindings.OMNameResolver_new(latest_block_time, latest_block_height); + Reference.reachabilityFence(latest_block_time); + Reference.reachabilityFence(latest_block_height); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OMNameResolver ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OMNameResolver(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Informs the [`OMNameResolver`] of the passage of time in the form of a new best Bitcoin + * block. + * + * This will call back to resolve some pending queries which have timed out. + */ + public void new_best_block(int height, int time) { + bindings.OMNameResolver_new_best_block(this.ptr, height, time); + Reference.reachabilityFence(this); + Reference.reachabilityFence(height); + Reference.reachabilityFence(time); + } + + /** + * Begins the process of resolving a BIP 353 Human Readable Name. + * + * Returns a [`DNSSECQuery`] onion message and a [`DNSResolverContext`] which should be sent + * to a resolver (with the context used to generate the blinded response path) on success. + */ + public Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ resolve_name(byte[] payment_id, org.ldk.structs.HumanReadableName name, org.ldk.structs.EntropySource entropy_source) { + long ret = bindings.OMNameResolver_resolve_name(this.ptr, InternalUtils.check_arr_len(payment_id, 32), name.ptr, entropy_source.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(payment_id); + Reference.reachabilityFence(name); + Reference.reachabilityFence(entropy_source); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ ret_hu_conv = Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.add(entropy_source); }; + return ret_hu_conv; + } + + /** + * Handles a [`DNSSECProof`] message, attempting to verify it and match it against a pending + * query. + * + * If verification succeeds, the resulting bitcoin: URI is parsed to find a contained + * [`Offer`]. + * + * Note that a single proof for a wildcard DNS entry may complete several requests for + * different [`HumanReadableName`]s. + * + * If an [`Offer`] is found, it, as well as the [`PaymentId`] and original `name` passed to + * [`Self::resolve_name`] are returned. + */ + public Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ handle_dnssec_proof_for_offer(org.ldk.structs.DNSSECProof msg, org.ldk.structs.DNSResolverContext context) { + long ret = bindings.OMNameResolver_handle_dnssec_proof_for_offer(this.ptr, msg.ptr, context.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(msg); + Reference.reachabilityFence(context); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Handles a [`DNSSECProof`] message, attempting to verify it and match it against any pending + * queries. + * + * If verification succeeds, all matching [`PaymentId`] and [`HumanReadableName`]s passed to + * [`Self::resolve_name`], as well as the resolved bitcoin: URI are returned. + * + * Note that a single proof for a wildcard DNS entry may complete several requests for + * different [`HumanReadableName`]s. + * + * This method is useful for those who handle bitcoin: URIs already, handling more than just + * BOLT12 [`Offer`]s. + */ + public Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ handle_dnssec_proof_for_uri(org.ldk.structs.DNSSECProof msg, org.ldk.structs.DNSResolverContext context) { + long ret = bindings.OMNameResolver_handle_dnssec_proof_for_uri(this.ptr, msg.ptr, context.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(msg); + Reference.reachabilityFence(context); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.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/Offer.java b/src/main/java/org/ldk/structs/Offer.java index 282feaac..e11281c7 100644 --- a/src/main/java/org/ldk/structs/Offer.java +++ b/src/main/java/org/ldk/structs/Offer.java @@ -175,13 +175,23 @@ public class Offer extends CommonBase { } /** - * The public key used by the recipient to sign invoices. + * The public key corresponding to the key used by the recipient to sign invoices. + * - If [`Offer::paths`] is empty, MUST be `Some` and contain the recipient's node id for + * sending an [`InvoiceRequest`]. + * - If [`Offer::paths`] is not empty, MAY be `Some` and contain a transient id. + * - If `None`, the signing pubkey will be the final blinded node id from the + * [`BlindedMessagePath`] in [`Offer::paths`] used to send the [`InvoiceRequest`]. + * + * See also [`Bolt12Invoice::signing_pubkey`]. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`Bolt12Invoice::signing_pubkey`]: crate::offers::invoice::Bolt12Invoice::signing_pubkey * * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ @Nullable - public byte[] signing_pubkey() { - byte[] ret = bindings.Offer_signing_pubkey(this.ptr); + public byte[] issuer_signing_pubkey() { + byte[] ret = bindings.Offer_issuer_signing_pubkey(this.ptr); Reference.reachabilityFence(this); return ret; } @@ -249,81 +259,35 @@ public class Offer extends CommonBase { } /** - * Similar to [`Offer::request_invoice`] except it: - * - 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_using_metadata`] to determine if the - * invoice was requested using a base [`ExpandedKey`] from which the payer id was derived, - * and + * Creates an [`InvoiceRequestBuilder`] for the offer, which + * - derives the [`InvoiceRequest::payer_signing_pubkey`] such that a different key can be used + * for each request in order to protect the sender's privacy, + * - sets [`InvoiceRequest::payer_metadata`] when [`InvoiceRequestBuilder::build_and_sign`] is + * called 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. * - * Useful to protect the sender's privacy. + * Errors if the offer contains unknown required features. * - * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id + * [`InvoiceRequest::payer_signing_pubkey`]: crate::offers::invoice_request::InvoiceRequest::payer_signing_pubkey * [`InvoiceRequest::payer_metadata`]: crate::offers::invoice_request::InvoiceRequest::payer_metadata * [`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.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(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); }; - return ret_hu_conv; - } - - /** - * Similar to [`Offer::request_invoice_deriving_payer_id`] except uses `payer_id` for the - * [`InvoiceRequest::payer_id`] instead of deriving a different key for each request. - * - * Useful for recurring payments using the same `payer_id` with different invoices. - * - * [`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.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)); + public Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ request_invoice(org.ldk.structs.ExpandedKey expanded_key, org.ldk.structs.Nonce nonce, byte[] payment_id) { + long ret = bindings.Offer_request_invoice(this.ptr, 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(nonce); Reference.reachabilityFence(payment_id); if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(expanded_key); }; return ret_hu_conv; } - /** - * Creates an [`InvoiceRequestBuilder`] for the offer with the given `metadata` and `payer_id`, - * which will be reflected in the `Bolt12Invoice` response. - * - * The `metadata` is useful for including information about the derivation of `payer_id` such - * that invoice response handling can be stateless. Also serves as payer-provided entropy while - * hashing in the signature calculation. - * - * This should not leak any information such as by using a simple BIP-32 derivation path. - * Otherwise, payments may be correlated. - * - * Errors if the offer contains unknown required features. - * - * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest - */ - public Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ request_invoice(byte[] metadata, byte[] payer_id) { - long ret = bindings.Offer_request_invoice(this.ptr, metadata, InternalUtils.check_arr_len(payer_id, 33)); - Reference.reachabilityFence(this); - Reference.reachabilityFence(metadata); - Reference.reachabilityFence(payer_id); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - /** * Generates a non-cryptographic 64-bit hash of the Offer. */ diff --git a/src/main/java/org/ldk/structs/OfferWithDerivedMetadataBuilder.java b/src/main/java/org/ldk/structs/OfferWithDerivedMetadataBuilder.java index 6c11f19b..e0db9c47 100644 --- a/src/main/java/org/ldk/structs/OfferWithDerivedMetadataBuilder.java +++ b/src/main/java/org/ldk/structs/OfferWithDerivedMetadataBuilder.java @@ -46,7 +46,7 @@ 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 [`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. + * `node_id` is used for [`Offer::issuer_signing_pubkey`]. * * Also, sets the metadata when [`OfferBuilder::build`] is called such that it can be used by * [`InvoiceRequest::verify_using_metadata`] to determine if the request was produced for the @@ -98,8 +98,8 @@ public class OfferWithDerivedMetadataBuilder extends CommonBase { } /** - * Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has - * already passed is valid and can be checked for using [`Offer::is_expired`]. + * Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. + * Any expiry that has already passed is valid and can be checked for using [`Offer::is_expired`]. * * Successive calls to this method will override the previous setting. */ @@ -136,7 +136,7 @@ public class OfferWithDerivedMetadataBuilder extends CommonBase { /** * Adds a blinded path to [`Offer::paths`]. Must include at least one path if only connected by - * private channels or if [`Offer::signing_pubkey`] is not a public node id. + * private channels or if [`Offer::issuer_signing_pubkey`] is not a public node id. * * Successive calls to this method will add another blinded path. Caller is responsible for not * adding duplicate paths. diff --git a/src/main/java/org/ldk/structs/OfferWithExplicitMetadataBuilder.java b/src/main/java/org/ldk/structs/OfferWithExplicitMetadataBuilder.java index 3867ed62..5774a214 100644 --- a/src/main/java/org/ldk/structs/OfferWithExplicitMetadataBuilder.java +++ b/src/main/java/org/ldk/structs/OfferWithExplicitMetadataBuilder.java @@ -43,8 +43,8 @@ public class OfferWithExplicitMetadataBuilder extends CommonBase { } /** - * Creates a new builder for an offer using the [`Offer::signing_pubkey`] for signing invoices. - * The associated secret key must be remembered while the offer is valid. + * Creates a new builder for an offer using the `signing_pubkey` for signing invoices. The + * associated secret key must be remembered while the offer is valid. * * Use a different pubkey per offer to avoid correlating offers. * @@ -108,8 +108,8 @@ public class OfferWithExplicitMetadataBuilder extends CommonBase { } /** - * Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has - * already passed is valid and can be checked for using [`Offer::is_expired`]. + * Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. + * Any expiry that has already passed is valid and can be checked for using [`Offer::is_expired`]. * * Successive calls to this method will override the previous setting. */ @@ -146,7 +146,7 @@ public class OfferWithExplicitMetadataBuilder extends CommonBase { /** * Adds a blinded path to [`Offer::paths`]. Must include at least one path if only connected by - * private channels or if [`Offer::signing_pubkey`] is not a public node id. + * private channels or if [`Offer::issuer_signing_pubkey`] is not a public node id. * * Successive calls to this method will add another blinded path. Caller is responsible for not * adding duplicate paths. diff --git a/src/main/java/org/ldk/structs/OffersContext.java b/src/main/java/org/ldk/structs/OffersContext.java index 9a346e8d..d51c852c 100644 --- a/src/main/java/org/ldk/structs/OffersContext.java +++ b/src/main/java/org/ldk/structs/OffersContext.java @@ -123,9 +123,29 @@ public class OffersContext extends CommonBase { * [`Bolt12Invoice::payment_hash`]: crate::offers::invoice::Bolt12Invoice::payment_hash */ public final byte[] payment_hash; + /** + * A nonce used for authenticating that a received [`InvoiceError`] is for a valid + * sent [`Bolt12Invoice`]. + * + * [`InvoiceError`]: crate::offers::invoice_error::InvoiceError + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + */ + public final org.ldk.structs.Nonce nonce; + /** + * Authentication code for the [`PaymentHash`], which should be checked when the context is + * used to log the received [`InvoiceError`]. + * + * [`InvoiceError`]: crate::offers::invoice_error::InvoiceError + */ + public final byte[] hmac; private InboundPayment(long ptr, bindings.LDKOffersContext.InboundPayment obj) { super(null, ptr); this.payment_hash = obj.payment_hash; + 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; } } long clone_ptr() { @@ -175,9 +195,11 @@ public class OffersContext extends CommonBase { /** * 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)); + public static OffersContext inbound_payment(byte[] payment_hash, org.ldk.structs.Nonce nonce, byte[] hmac) { + long ret = bindings.OffersContext_inbound_payment(InternalUtils.check_arr_len(payment_hash, 32), nonce.ptr, InternalUtils.check_arr_len(hmac, 32)); Reference.reachabilityFence(payment_hash); + 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); }; diff --git a/src/main/java/org/ldk/structs/OnionMessenger.java b/src/main/java/org/ldk/structs/OnionMessenger.java index 798d2deb..e9c530d8 100644 --- a/src/main/java/org/ldk/structs/OnionMessenger.java +++ b/src/main/java/org/ldk/structs/OnionMessenger.java @@ -79,14 +79,16 @@ import javax.annotation.Nullable; * # let custom_message_handler = IgnoringMessageHandler {}; * # let offers_message_handler = IgnoringMessageHandler {}; * # let async_payments_message_handler = IgnoringMessageHandler {}; + * # let dns_resolution_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, &async_payments_message_handler, &custom_message_handler + * &offers_message_handler, &async_payments_message_handler, &dns_resolution_message_handler, + * &custom_message_handler, * ); * - * # #[derive(Debug, Clone)] + * # #[derive(Clone, Debug)] * # struct YourCustomMessage {} * impl Writeable for YourCustomMessage { * \tfn write(&self, w: &mut W) -> Result<(), io::Error> { @@ -139,8 +141,8 @@ 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.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); + 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.DNSResolverMessageHandler dns_resolver, 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, dns_resolver.ptr, custom_handler.ptr); Reference.reachabilityFence(entropy_source); Reference.reachabilityFence(node_signer); Reference.reachabilityFence(logger); @@ -148,6 +150,7 @@ public class OnionMessenger extends CommonBase { Reference.reachabilityFence(message_router); Reference.reachabilityFence(offers_handler); Reference.reachabilityFence(async_payments_handler); + Reference.reachabilityFence(dns_resolver); 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); } @@ -159,6 +162,7 @@ public class OnionMessenger extends CommonBase { 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(dns_resolver); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(custom_handler); }; return ret_hu_conv; } @@ -186,8 +190,8 @@ public class OnionMessenger extends CommonBase { * onion messages are persisted and only persist onion messages for relevant * peers. */ - 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); + 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.DNSResolverMessageHandler dns_resolver, 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, dns_resolver.ptr, custom_handler.ptr); Reference.reachabilityFence(entropy_source); Reference.reachabilityFence(node_signer); Reference.reachabilityFence(logger); @@ -195,6 +199,7 @@ public class OnionMessenger extends CommonBase { Reference.reachabilityFence(message_router); Reference.reachabilityFence(offers_handler); Reference.reachabilityFence(async_payments_handler); + Reference.reachabilityFence(dns_resolver); 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); } @@ -206,6 +211,7 @@ public class OnionMessenger extends CommonBase { 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(dns_resolver); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(custom_handler); }; 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 de138eff..d5b3affe 100644 --- a/src/main/java/org/ldk/structs/OpenChannelV2.java +++ b/src/main/java/org/ldk/structs/OpenChannelV2.java @@ -9,9 +9,11 @@ import javax.annotation.Nullable; /** - * An open_channel2 message to be sent by or received from the channel initiator. + * An [`open_channel2`] message to be sent by or received from the channel initiator. * * Used in V2 channel establishment + * + * [`open_channel2`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel2-message */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class OpenChannelV2 extends CommonBase { diff --git a/src/main/java/org/ldk/structs/Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.java b/src/main/java/org/ldk/structs/Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.java new file mode 100644 index 00000000..1a7da3aa --- /dev/null +++ b/src/main/java/org/ldk/structs/Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ or not + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ extends CommonBase { + private Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_free(ptr); } + } + static Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ constr_from_ptr(long ptr) { + bindings.LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ raw_val = bindings.LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.Some.class) { + return new Some(ptr, (bindings.LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.Some)raw_val); + } + if (raw_val.getClass() == bindings.LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.None.class) { + return new None(ptr, (bindings.LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * When we're in this state, this COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ contains a crate::c_types::derived::C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ + */ + public final static class Some extends Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ { + public final org.ldk.structs.TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ some; + private Some(long ptr, bindings.LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.Some obj) { + super(null, ptr); + long some = obj.some; + TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ some_hu_conv = new TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ(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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ contains nothing + */ + public final static class None extends Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ { + private None(long ptr, bindings.LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.None obj) { + super(null, ptr); + } + } + /** + * Constructs a new COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ containing a crate::c_types::derived::C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ + */ + public static Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ some(org.ldk.structs.TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ o) { + long ret = bindings.COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_some(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ containing nothing + */ + public static Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ none() { + long ret = bindings.COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ clone() { + long ret = bindings.COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.java b/src/main/java/org/ldk/structs/Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.java new file mode 100644 index 00000000..134fa735 --- /dev/null +++ b/src/main/java/org/ldk/structs/Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ or not + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ extends CommonBase { + private Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_free(ptr); } + } + static Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ constr_from_ptr(long ptr) { + bindings.LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ raw_val = bindings.LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.Some.class) { + return new Some(ptr, (bindings.LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.Some)raw_val); + } + if (raw_val.getClass() == bindings.LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.None.class) { + return new None(ptr, (bindings.LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * When we're in this state, this COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ contains a crate::c_types::derived::C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ + */ + public final static class Some extends Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ { + public final org.ldk.structs.TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ some; + private Some(long ptr, bindings.LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.Some obj) { + super(null, ptr); + long some = obj.some; + TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ some_hu_conv = new TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ(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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ contains nothing + */ + public final static class None extends Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ { + private None(long ptr, bindings.LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.None obj) { + super(null, ptr); + } + } + /** + * Constructs a new COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ containing a crate::c_types::derived::C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ + */ + public static Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ some(org.ldk.structs.TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ o) { + long ret = bindings.COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_some(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ containing nothing + */ + public static Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ none() { + long ret = bindings.COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ clone() { + long ret = bindings.COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.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_DNSResolverMessageResponseInstructionZZ.java b/src/main/java/org/ldk/structs/Option_C2Tuple_DNSResolverMessageResponseInstructionZZ.java new file mode 100644 index 00000000..71abcb12 --- /dev/null +++ b/src/main/java/org/ldk/structs/Option_C2Tuple_DNSResolverMessageResponseInstructionZZ.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_DNSResolverMessageResponseInstructionZ or not + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Option_C2Tuple_DNSResolverMessageResponseInstructionZZ extends CommonBase { + private Option_C2Tuple_DNSResolverMessageResponseInstructionZZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_free(ptr); } + } + static Option_C2Tuple_DNSResolverMessageResponseInstructionZZ constr_from_ptr(long ptr) { + bindings.LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ raw_val = bindings.LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ.Some.class) { + return new Some(ptr, (bindings.LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ.Some)raw_val); + } + if (raw_val.getClass() == bindings.LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ.None.class) { + return new None(ptr, (bindings.LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * When we're in this state, this COption_C2Tuple_DNSResolverMessageResponseInstructionZZ contains a crate::c_types::derived::C2Tuple_DNSResolverMessageResponseInstructionZ + */ + public final static class Some extends Option_C2Tuple_DNSResolverMessageResponseInstructionZZ { + public final org.ldk.structs.TwoTuple_DNSResolverMessageResponseInstructionZ some; + private Some(long ptr, bindings.LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ.Some obj) { + super(null, ptr); + long some = obj.some; + TwoTuple_DNSResolverMessageResponseInstructionZ some_hu_conv = new TwoTuple_DNSResolverMessageResponseInstructionZ(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_DNSResolverMessageResponseInstructionZZ contains nothing + */ + public final static class None extends Option_C2Tuple_DNSResolverMessageResponseInstructionZZ { + private None(long ptr, bindings.LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ.None obj) { + super(null, ptr); + } + } + /** + * Constructs a new COption_C2Tuple_DNSResolverMessageResponseInstructionZZ containing a crate::c_types::derived::C2Tuple_DNSResolverMessageResponseInstructionZ + */ + public static Option_C2Tuple_DNSResolverMessageResponseInstructionZZ some(org.ldk.structs.TwoTuple_DNSResolverMessageResponseInstructionZ o) { + long ret = bindings.COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_some(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_DNSResolverMessageResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_DNSResolverMessageResponseInstructionZZ.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_DNSResolverMessageResponseInstructionZZ containing nothing + */ + public static Option_C2Tuple_DNSResolverMessageResponseInstructionZZ none() { + long ret = bindings.COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_DNSResolverMessageResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_DNSResolverMessageResponseInstructionZZ.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_DNSResolverMessageResponseInstructionZZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new COption_C2Tuple_DNSResolverMessageResponseInstructionZZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_C2Tuple_DNSResolverMessageResponseInstructionZZ clone() { + long ret = bindings.COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_DNSResolverMessageResponseInstructionZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_DNSResolverMessageResponseInstructionZZ.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_PublicKeyChannelIdZZ.java b/src/main/java/org/ldk/structs/Option_C2Tuple_PublicKeyChannelIdZZ.java new file mode 100644 index 00000000..a69ca759 --- /dev/null +++ b/src/main/java/org/ldk/structs/Option_C2Tuple_PublicKeyChannelIdZZ.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_PublicKeyChannelIdZ or not + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Option_C2Tuple_PublicKeyChannelIdZZ extends CommonBase { + private Option_C2Tuple_PublicKeyChannelIdZZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.COption_C2Tuple_PublicKeyChannelIdZZ_free(ptr); } + } + static Option_C2Tuple_PublicKeyChannelIdZZ constr_from_ptr(long ptr) { + bindings.LDKCOption_C2Tuple_PublicKeyChannelIdZZ raw_val = bindings.LDKCOption_C2Tuple_PublicKeyChannelIdZZ_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKCOption_C2Tuple_PublicKeyChannelIdZZ.Some.class) { + return new Some(ptr, (bindings.LDKCOption_C2Tuple_PublicKeyChannelIdZZ.Some)raw_val); + } + if (raw_val.getClass() == bindings.LDKCOption_C2Tuple_PublicKeyChannelIdZZ.None.class) { + return new None(ptr, (bindings.LDKCOption_C2Tuple_PublicKeyChannelIdZZ.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * When we're in this state, this COption_C2Tuple_PublicKeyChannelIdZZ contains a crate::c_types::derived::C2Tuple_PublicKeyChannelIdZ + */ + public final static class Some extends Option_C2Tuple_PublicKeyChannelIdZZ { + public final org.ldk.structs.TwoTuple_PublicKeyChannelIdZ some; + private Some(long ptr, bindings.LDKCOption_C2Tuple_PublicKeyChannelIdZZ.Some obj) { + super(null, ptr); + long some = obj.some; + TwoTuple_PublicKeyChannelIdZ some_hu_conv = new TwoTuple_PublicKeyChannelIdZ(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_PublicKeyChannelIdZZ contains nothing + */ + public final static class None extends Option_C2Tuple_PublicKeyChannelIdZZ { + private None(long ptr, bindings.LDKCOption_C2Tuple_PublicKeyChannelIdZZ.None obj) { + super(null, ptr); + } + } + /** + * Constructs a new COption_C2Tuple_PublicKeyChannelIdZZ containing a crate::c_types::derived::C2Tuple_PublicKeyChannelIdZ + */ + public static Option_C2Tuple_PublicKeyChannelIdZZ some(org.ldk.structs.TwoTuple_PublicKeyChannelIdZ o) { + long ret = bindings.COption_C2Tuple_PublicKeyChannelIdZZ_some(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_PublicKeyChannelIdZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_PublicKeyChannelIdZZ.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_PublicKeyChannelIdZZ containing nothing + */ + public static Option_C2Tuple_PublicKeyChannelIdZZ none() { + long ret = bindings.COption_C2Tuple_PublicKeyChannelIdZZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_PublicKeyChannelIdZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_PublicKeyChannelIdZZ.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_PublicKeyChannelIdZZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new COption_C2Tuple_PublicKeyChannelIdZZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_C2Tuple_PublicKeyChannelIdZZ clone() { + long ret = bindings.COption_C2Tuple_PublicKeyChannelIdZZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_C2Tuple_PublicKeyChannelIdZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_PublicKeyChannelIdZZ.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/ParseOrSemanticError.java b/src/main/java/org/ldk/structs/ParseOrSemanticError.java index 43775b55..5c61077b 100644 --- a/src/main/java/org/ldk/structs/ParseOrSemanticError.java +++ b/src/main/java/org/ldk/structs/ParseOrSemanticError.java @@ -40,7 +40,7 @@ public class ParseOrSemanticError extends CommonBase { private ParseError(long ptr, bindings.LDKParseOrSemanticError.ParseError obj) { super(null, ptr); long parse_error = obj.parse_error; - org.ldk.structs.Bolt11ParseError parse_error_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(parse_error); + org.ldk.structs.Bolt11ParseError parse_error_hu_conv = null; if (parse_error < 0 || parse_error > 4096) { parse_error_hu_conv = new org.ldk.structs.Bolt11ParseError(null, parse_error); } if (parse_error_hu_conv != null) { parse_error_hu_conv.ptrs_to.add(this); }; this.parse_error = parse_error_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ParsedOnionMessageContents.java b/src/main/java/org/ldk/structs/ParsedOnionMessageContents.java index 7c1eeb30..4149ea2c 100644 --- a/src/main/java/org/ldk/structs/ParsedOnionMessageContents.java +++ b/src/main/java/org/ldk/structs/ParsedOnionMessageContents.java @@ -26,6 +26,9 @@ public class ParsedOnionMessageContents extends CommonBase { if (raw_val.getClass() == bindings.LDKParsedOnionMessageContents.Offers.class) { return new Offers(ptr, (bindings.LDKParsedOnionMessageContents.Offers)raw_val); } + if (raw_val.getClass() == bindings.LDKParsedOnionMessageContents.DNSResolver.class) { + return new DNSResolver(ptr, (bindings.LDKParsedOnionMessageContents.DNSResolver)raw_val); + } if (raw_val.getClass() == bindings.LDKParsedOnionMessageContents.Custom.class) { return new Custom(ptr, (bindings.LDKParsedOnionMessageContents.Custom)raw_val); } @@ -45,6 +48,19 @@ public class ParsedOnionMessageContents extends CommonBase { this.offers = offers_hu_conv; } } + /** + * A message requesting or providing a DNSSEC proof + */ + public final static class DNSResolver extends ParsedOnionMessageContents { + public final org.ldk.structs.DNSResolverMessage dns_resolver; + private DNSResolver(long ptr, bindings.LDKParsedOnionMessageContents.DNSResolver obj) { + super(null, ptr); + long dns_resolver = obj.dns_resolver; + org.ldk.structs.DNSResolverMessage dns_resolver_hu_conv = org.ldk.structs.DNSResolverMessage.constr_from_ptr(dns_resolver); + if (dns_resolver_hu_conv != null) { dns_resolver_hu_conv.ptrs_to.add(this); }; + this.dns_resolver = dns_resolver_hu_conv; + } + } /** * A custom onion message specified by the user. */ @@ -88,6 +104,18 @@ public class ParsedOnionMessageContents extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new DNSResolver-variant ParsedOnionMessageContents + */ + public static ParsedOnionMessageContents dnsresolver(org.ldk.structs.DNSResolverMessage a) { + long ret = bindings.ParsedOnionMessageContents_dnsresolver(a.ptr); + Reference.reachabilityFence(a); + 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); }; + return ret_hu_conv; + } + /** * Utility method to constructs a new Custom-variant ParsedOnionMessageContents */ diff --git a/src/main/java/org/ldk/structs/PaymentContext.java b/src/main/java/org/ldk/structs/PaymentContext.java index 4508c14c..d0d70d53 100644 --- a/src/main/java/org/ldk/structs/PaymentContext.java +++ b/src/main/java/org/ldk/structs/PaymentContext.java @@ -24,9 +24,6 @@ public class PaymentContext extends CommonBase { } static PaymentContext constr_from_ptr(long ptr) { bindings.LDKPaymentContext raw_val = bindings.LDKPaymentContext_ref_from_ptr(ptr); - if (raw_val.getClass() == bindings.LDKPaymentContext.Unknown.class) { - return new Unknown(ptr, (bindings.LDKPaymentContext.Unknown)raw_val); - } if (raw_val.getClass() == bindings.LDKPaymentContext.Bolt12Offer.class) { return new Bolt12Offer(ptr, (bindings.LDKPaymentContext.Bolt12Offer)raw_val); } @@ -36,19 +33,6 @@ public class PaymentContext extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } - /** - * The payment context was unknown. - */ - public final static class Unknown extends PaymentContext { - public final org.ldk.structs.UnknownPaymentContext unknown; - private Unknown(long ptr, bindings.LDKPaymentContext.Unknown obj) { - super(null, ptr); - long unknown = obj.unknown; - org.ldk.structs.UnknownPaymentContext unknown_hu_conv = null; if (unknown < 0 || unknown > 4096) { unknown_hu_conv = new org.ldk.structs.UnknownPaymentContext(null, unknown); } - if (unknown_hu_conv != null) { unknown_hu_conv.ptrs_to.add(this); }; - this.unknown = unknown_hu_conv; - } - } /** * The payment was made for an invoice requested from a BOLT 12 [`Offer`]. * @@ -97,18 +81,6 @@ public class PaymentContext extends CommonBase { return ret_hu_conv; } - /** - * Utility method to constructs a new Unknown-variant PaymentContext - */ - public static PaymentContext unknown(org.ldk.structs.UnknownPaymentContext a) { - long ret = bindings.PaymentContext_unknown(a.ptr); - Reference.reachabilityFence(a); - 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); }; - return ret_hu_conv; - } - /** * Utility method to constructs a new Bolt12Offer-variant PaymentContext */ diff --git a/src/main/java/org/ldk/structs/PaymentPurpose.java b/src/main/java/org/ldk/structs/PaymentPurpose.java index cdb692b7..fa337b30 100644 --- a/src/main/java/org/ldk/structs/PaymentPurpose.java +++ b/src/main/java/org/ldk/structs/PaymentPurpose.java @@ -98,6 +98,10 @@ public class PaymentPurpose extends CommonBase { * The context of the payment such as information about the corresponding [`Offer`] and * [`InvoiceRequest`]. * + * This includes the Human Readable Name which the sender indicated they were paying to, + * for possible recipient disambiguation if you're using a single wildcard DNS entry to + * resolve to many recipients. + * * [`Offer`]: crate::offers::offer::Offer * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest */ diff --git a/src/main/java/org/ldk/structs/PaymentSendFailure.java b/src/main/java/org/ldk/structs/PaymentSendFailure.java deleted file mode 100644 index 98baefad..00000000 --- a/src/main/java/org/ldk/structs/PaymentSendFailure.java +++ /dev/null @@ -1,278 +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; - - -/** - * If a payment fails to send with [`ChannelManager::send_payment_with_route`], it can be in one - * of several states. This enum is returned as the Err() type describing which state the payment - * is in, see the description of individual enum states for more. - * - * [`ChannelManager::send_payment_with_route`]: crate::ln::channelmanager::ChannelManager::send_payment_with_route - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class PaymentSendFailure extends CommonBase { - private PaymentSendFailure(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.PaymentSendFailure_free(ptr); } - } - static PaymentSendFailure constr_from_ptr(long ptr) { - bindings.LDKPaymentSendFailure raw_val = bindings.LDKPaymentSendFailure_ref_from_ptr(ptr); - if (raw_val.getClass() == bindings.LDKPaymentSendFailure.ParameterError.class) { - return new ParameterError(ptr, (bindings.LDKPaymentSendFailure.ParameterError)raw_val); - } - if (raw_val.getClass() == bindings.LDKPaymentSendFailure.PathParameterError.class) { - return new PathParameterError(ptr, (bindings.LDKPaymentSendFailure.PathParameterError)raw_val); - } - if (raw_val.getClass() == bindings.LDKPaymentSendFailure.AllFailedResendSafe.class) { - return new AllFailedResendSafe(ptr, (bindings.LDKPaymentSendFailure.AllFailedResendSafe)raw_val); - } - if (raw_val.getClass() == bindings.LDKPaymentSendFailure.DuplicatePayment.class) { - return new DuplicatePayment(ptr, (bindings.LDKPaymentSendFailure.DuplicatePayment)raw_val); - } - if (raw_val.getClass() == bindings.LDKPaymentSendFailure.PartialFailure.class) { - return new PartialFailure(ptr, (bindings.LDKPaymentSendFailure.PartialFailure)raw_val); - } - assert false; return null; // Unreachable without extending the (internal) bindings interface - } - - /** - * A parameter which was passed to send_payment was invalid, preventing us from attempting to - * send the payment at all. - * - * You can freely resend the payment in full (with the parameter error fixed). - * - * Because the payment failed outright, no payment tracking is done and no - * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated. - * - * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed - * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed - */ - public final static class ParameterError extends PaymentSendFailure { - public final org.ldk.structs.APIError parameter_error; - private ParameterError(long ptr, bindings.LDKPaymentSendFailure.ParameterError obj) { - super(null, ptr); - long parameter_error = obj.parameter_error; - org.ldk.structs.APIError parameter_error_hu_conv = org.ldk.structs.APIError.constr_from_ptr(parameter_error); - if (parameter_error_hu_conv != null) { parameter_error_hu_conv.ptrs_to.add(this); }; - this.parameter_error = parameter_error_hu_conv; - } - } - /** - * A parameter in a single path which was passed to send_payment was invalid, preventing us - * from attempting to send the payment at all. - * - * You can freely resend the payment in full (with the parameter error fixed). - * - * Because the payment failed outright, no payment tracking is done and no - * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated. - * - * The results here are ordered the same as the paths in the route object which was passed to - * send_payment. - * - * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed - * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed - */ - public final static class PathParameterError extends PaymentSendFailure { - public final Result_NoneAPIErrorZ[] path_parameter_error; - private PathParameterError(long ptr, bindings.LDKPaymentSendFailure.PathParameterError obj) { - super(null, ptr); - long[] path_parameter_error = obj.path_parameter_error; - int path_parameter_error_conv_22_len = path_parameter_error.length; - Result_NoneAPIErrorZ[] path_parameter_error_conv_22_arr = new Result_NoneAPIErrorZ[path_parameter_error_conv_22_len]; - for (int w = 0; w < path_parameter_error_conv_22_len; w++) { - long path_parameter_error_conv_22 = path_parameter_error[w]; - Result_NoneAPIErrorZ path_parameter_error_conv_22_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(path_parameter_error_conv_22); - path_parameter_error_conv_22_arr[w] = path_parameter_error_conv_22_hu_conv; - } - this.path_parameter_error = path_parameter_error_conv_22_arr; - } - } - /** - * All paths which were attempted failed to send, with no channel state change taking place. - * You can freely resend the payment in full (though you probably want to do so over different - * paths than the ones selected). - * - * Because the payment failed outright, no payment tracking is done and no - * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated. - * - * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed - * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed - */ - public final static class AllFailedResendSafe extends PaymentSendFailure { - public final APIError[] all_failed_resend_safe; - private AllFailedResendSafe(long ptr, bindings.LDKPaymentSendFailure.AllFailedResendSafe obj) { - super(null, ptr); - long[] all_failed_resend_safe = obj.all_failed_resend_safe; - int all_failed_resend_safe_conv_10_len = all_failed_resend_safe.length; - APIError[] all_failed_resend_safe_conv_10_arr = new APIError[all_failed_resend_safe_conv_10_len]; - for (int k = 0; k < all_failed_resend_safe_conv_10_len; k++) { - long all_failed_resend_safe_conv_10 = all_failed_resend_safe[k]; - org.ldk.structs.APIError all_failed_resend_safe_conv_10_hu_conv = org.ldk.structs.APIError.constr_from_ptr(all_failed_resend_safe_conv_10); - if (all_failed_resend_safe_conv_10_hu_conv != null) { all_failed_resend_safe_conv_10_hu_conv.ptrs_to.add(this); }; - all_failed_resend_safe_conv_10_arr[k] = all_failed_resend_safe_conv_10_hu_conv; - } - this.all_failed_resend_safe = all_failed_resend_safe_conv_10_arr; - } - } - /** - * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not - * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]). - * - * [`PaymentId`]: crate::ln::channelmanager::PaymentId - * [`Event::PaymentSent`]: crate::events::Event::PaymentSent - * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed - */ - public final static class DuplicatePayment extends PaymentSendFailure { - private DuplicatePayment(long ptr, bindings.LDKPaymentSendFailure.DuplicatePayment obj) { - super(null, ptr); - } - } - /** - * Some paths that were attempted failed to send, though some paths may have succeeded. At least - * some paths have irrevocably committed to the HTLC. - * - * The results here are ordered the same as the paths in the route object that was passed to - * send_payment. - * - * Any entries that contain `Err(APIError::MonitorUpdateInprogress)` will send once a - * [`MonitorEvent::Completed`] is provided for the next-hop channel with the latest update_id. - * - * [`MonitorEvent::Completed`]: crate::chain::channelmonitor::MonitorEvent::Completed - */ - public final static class PartialFailure extends PaymentSendFailure { - /** - * The errors themselves, in the same order as the paths from the route. - */ - public final Result_NoneAPIErrorZ[] results; - /** - * If some paths failed without irrevocably committing to the new HTLC(s), this will - * contain a [`RouteParameters`] object for the failing paths. - * - * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - @Nullable public final org.ldk.structs.RouteParameters failed_paths_retry; - /** - * The payment id for the payment, which is now at least partially pending. - */ - public final byte[] payment_id; - private PartialFailure(long ptr, bindings.LDKPaymentSendFailure.PartialFailure obj) { - super(null, ptr); - long[] results = obj.results; - int results_conv_22_len = results.length; - Result_NoneAPIErrorZ[] results_conv_22_arr = new Result_NoneAPIErrorZ[results_conv_22_len]; - for (int w = 0; w < results_conv_22_len; w++) { - long results_conv_22 = results[w]; - Result_NoneAPIErrorZ results_conv_22_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(results_conv_22); - results_conv_22_arr[w] = results_conv_22_hu_conv; - } - this.results = results_conv_22_arr; - long failed_paths_retry = obj.failed_paths_retry; - org.ldk.structs.RouteParameters failed_paths_retry_hu_conv = null; if (failed_paths_retry < 0 || failed_paths_retry > 4096) { failed_paths_retry_hu_conv = new org.ldk.structs.RouteParameters(null, failed_paths_retry); } - if (failed_paths_retry_hu_conv != null) { failed_paths_retry_hu_conv.ptrs_to.add(this); }; - this.failed_paths_retry = failed_paths_retry_hu_conv; - this.payment_id = obj.payment_id; - } - } - long clone_ptr() { - long ret = bindings.PaymentSendFailure_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a copy of the PaymentSendFailure - */ - public PaymentSendFailure clone() { - long ret = bindings.PaymentSendFailure_clone(this.ptr); - Reference.reachabilityFence(this); - 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(this); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new ParameterError-variant PaymentSendFailure - */ - public static PaymentSendFailure parameter_error(org.ldk.structs.APIError a) { - long ret = bindings.PaymentSendFailure_parameter_error(a.ptr); - Reference.reachabilityFence(a); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new PathParameterError-variant PaymentSendFailure - */ - public static PaymentSendFailure path_parameter_error(Result_NoneAPIErrorZ[] a) { - long ret = bindings.PaymentSendFailure_path_parameter_error(a != null ? Arrays.stream(a).mapToLong(a_conv_22 -> a_conv_22.ptr).toArray() : null); - Reference.reachabilityFence(a); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure - */ - public static PaymentSendFailure all_failed_resend_safe(APIError[] a) { - long ret = bindings.PaymentSendFailure_all_failed_resend_safe(a != null ? Arrays.stream(a).mapToLong(a_conv_10 -> a_conv_10.ptr).toArray() : null); - Reference.reachabilityFence(a); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure - */ - public static PaymentSendFailure duplicate_payment() { - long ret = bindings.PaymentSendFailure_duplicate_payment(); - 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); }; - return ret_hu_conv; - } - - /** - * Utility method to constructs a new PartialFailure-variant PaymentSendFailure - */ - public static PaymentSendFailure partial_failure(Result_NoneAPIErrorZ[] results, org.ldk.structs.RouteParameters failed_paths_retry, byte[] payment_id) { - long ret = bindings.PaymentSendFailure_partial_failure(results != null ? Arrays.stream(results).mapToLong(results_conv_22 -> results_conv_22.ptr).toArray() : null, failed_paths_retry.ptr, InternalUtils.check_arr_len(payment_id, 32)); - Reference.reachabilityFence(results); - Reference.reachabilityFence(failed_paths_retry); - Reference.reachabilityFence(payment_id); - 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); }; - return ret_hu_conv; - } - - /** - * Checks if two PaymentSendFailures contain equal inner contents. - * This ignores pointers and is_owned flags and looks at the values in fields. - */ - public boolean eq(org.ldk.structs.PaymentSendFailure b) { - boolean ret = bindings.PaymentSendFailure_eq(this.ptr, b.ptr); - Reference.reachabilityFence(this); - Reference.reachabilityFence(b); - return ret; - } - - @Override public boolean equals(Object o) { - if (!(o instanceof PaymentSendFailure)) return false; - return this.eq((PaymentSendFailure)o); - } -} diff --git a/src/main/java/org/ldk/structs/PeerManager.java b/src/main/java/org/ldk/structs/PeerManager.java index 3242ca13..09fcbfdf 100644 --- a/src/main/java/org/ldk/structs/PeerManager.java +++ b/src/main/java/org/ldk/structs/PeerManager.java @@ -224,8 +224,11 @@ public class PeerManager extends CommonBase { * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy * issues! * - * You don't have to call this function explicitly if you are using [`lightning-net-tokio`] - * or one of the other clients provided in our language bindings. + * This should be called any time we may have messages to send. It is automatically called by + * [`lightning-net-tokio`] after processing incoming messages, and by + * [`lightning-background-processor`] when channel state has changed. Therefore, If you are not + * using both [`lightning-net-tokio`] and [`lightning-background-processor`], you may need to call + * this function manually to prevent messages from being delayed. * * Note that if there are any other calls to this function waiting on lock(s) this may return * without doing any work. All available events that need handling will be handled before the diff --git a/src/main/java/org/ldk/structs/PendingHTLCRouting.java b/src/main/java/org/ldk/structs/PendingHTLCRouting.java index 3d4773c0..d3745f54 100644 --- a/src/main/java/org/ldk/structs/PendingHTLCRouting.java +++ b/src/main/java/org/ldk/structs/PendingHTLCRouting.java @@ -197,6 +197,12 @@ public class PendingHTLCRouting extends CommonBase { * Set if this HTLC is the final hop in a multi-hop blinded path. */ public final boolean requires_blinded_error; + /** + * Set if we are receiving a keysend to a blinded path, meaning we created the + * [`PaymentSecret`] and should verify it using our + * [`NodeSigner::get_inbound_payment_key`]. + */ + public final boolean has_recipient_created_payment_secret; private ReceiveKeysend(long ptr, bindings.LDKPendingHTLCRouting.ReceiveKeysend obj) { super(null, ptr); long payment_data = obj.payment_data; @@ -220,6 +226,7 @@ public class PendingHTLCRouting extends CommonBase { } this.custom_tlvs = custom_tlvs_conv_23_arr; this.requires_blinded_error = obj.requires_blinded_error; + this.has_recipient_created_payment_secret = obj.has_recipient_created_payment_secret; } } long clone_ptr() { @@ -275,14 +282,15 @@ public class PendingHTLCRouting extends CommonBase { /** * Utility method to constructs a new ReceiveKeysend-variant PendingHTLCRouting */ - public static PendingHTLCRouting receive_keysend(org.ldk.structs.FinalOnionHopData payment_data, byte[] payment_preimage, org.ldk.structs.Option_CVec_u8ZZ payment_metadata, int incoming_cltv_expiry, TwoTuple_u64CVec_u8ZZ[] custom_tlvs, boolean requires_blinded_error) { - long ret = bindings.PendingHTLCRouting_receive_keysend(payment_data.ptr, InternalUtils.check_arr_len(payment_preimage, 32), payment_metadata.ptr, incoming_cltv_expiry, custom_tlvs != null ? Arrays.stream(custom_tlvs).mapToLong(custom_tlvs_conv_23 -> custom_tlvs_conv_23.ptr).toArray() : null, requires_blinded_error); + public static PendingHTLCRouting receive_keysend(org.ldk.structs.FinalOnionHopData payment_data, byte[] payment_preimage, org.ldk.structs.Option_CVec_u8ZZ payment_metadata, int incoming_cltv_expiry, TwoTuple_u64CVec_u8ZZ[] custom_tlvs, boolean requires_blinded_error, boolean has_recipient_created_payment_secret) { + long ret = bindings.PendingHTLCRouting_receive_keysend(payment_data.ptr, InternalUtils.check_arr_len(payment_preimage, 32), payment_metadata.ptr, incoming_cltv_expiry, custom_tlvs != null ? Arrays.stream(custom_tlvs).mapToLong(custom_tlvs_conv_23 -> custom_tlvs_conv_23.ptr).toArray() : null, requires_blinded_error, has_recipient_created_payment_secret); Reference.reachabilityFence(payment_data); Reference.reachabilityFence(payment_preimage); Reference.reachabilityFence(payment_metadata); Reference.reachabilityFence(incoming_cltv_expiry); Reference.reachabilityFence(custom_tlvs); Reference.reachabilityFence(requires_blinded_error); + Reference.reachabilityFence(has_recipient_created_payment_secret); 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); }; diff --git a/src/main/java/org/ldk/structs/Persist.java b/src/main/java/org/ldk/structs/Persist.java index d7097c7f..3c12e09b 100644 --- a/src/main/java/org/ldk/structs/Persist.java +++ b/src/main/java/org/ldk/structs/Persist.java @@ -157,6 +157,13 @@ public class Persist extends CommonBase { * * Archiving the data in a backup location (rather than deleting it fully) is useful for * hedging against data loss in case of unexpected failure. + * + * Note that if a crash occurs during the archiving process, and its implementation is not + * atomic, a state may emerge with the archival operation only being partially complete. In + * that scenario, the monitor may still be loaded on startup pending successful completion of + * the archive process. Additionally, because the archive operation could be retried on + * restart, this method must in that case be idempotent, ensuring it can handle scenarios where + * the monitor already exists in the archive. */ void archive_persisted_channel(OutPoint channel_funding_outpoint); } @@ -274,6 +281,13 @@ public class Persist extends CommonBase { * * Archiving the data in a backup location (rather than deleting it fully) is useful for * hedging against data loss in case of unexpected failure. + * + * Note that if a crash occurs during the archiving process, and its implementation is not + * atomic, a state may emerge with the archival operation only being partially complete. In + * that scenario, the monitor may still be loaded on startup pending successful completion of + * the archive process. Additionally, because the archive operation could be retried on + * restart, this method must in that case be idempotent, ensuring it can handle scenarios where + * the monitor already exists in the archive. */ public void archive_persisted_channel(org.ldk.structs.OutPoint channel_funding_outpoint) { bindings.Persist_archive_persisted_channel(this.ptr, channel_funding_outpoint.ptr); diff --git a/src/main/java/org/ldk/structs/ProbabilisticScorer.java b/src/main/java/org/ldk/structs/ProbabilisticScorer.java index 488de5c9..5880a166 100644 --- a/src/main/java/org/ldk/structs/ProbabilisticScorer.java +++ b/src/main/java/org/ldk/structs/ProbabilisticScorer.java @@ -139,12 +139,41 @@ public class ProbabilisticScorer extends CommonBase { * with `scid` towards the given `target` node, based on the historical estimated liquidity * bounds. * + * Returns `None` if: + * - the given channel is not in the network graph, the provided `target` is not a party to + * the channel, or we don't have forwarding parameters for either direction in the channel. + * - `allow_fallback_estimation` is *not* set and there is no (or insufficient) historical + * data for the given channel. + * * These are the same bounds as returned by * [`Self::historical_estimated_channel_liquidity_probabilities`] (but not those returned by * [`Self::estimated_channel_liquidity_range`]). */ - public Option_f64Z historical_estimated_payment_success_probability(long scid, org.ldk.structs.NodeId target, long amount_msat, org.ldk.structs.ProbabilisticScoringFeeParameters params) { - long ret = bindings.ProbabilisticScorer_historical_estimated_payment_success_probability(this.ptr, scid, target.ptr, amount_msat, params.ptr); + public Option_f64Z historical_estimated_payment_success_probability(long scid, org.ldk.structs.NodeId target, long amount_msat, org.ldk.structs.ProbabilisticScoringFeeParameters params, boolean allow_fallback_estimation) { + long ret = bindings.ProbabilisticScorer_historical_estimated_payment_success_probability(this.ptr, scid, target.ptr, amount_msat, params.ptr, allow_fallback_estimation); + Reference.reachabilityFence(this); + Reference.reachabilityFence(scid); + Reference.reachabilityFence(target); + Reference.reachabilityFence(amount_msat); + Reference.reachabilityFence(params); + Reference.reachabilityFence(allow_fallback_estimation); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_f64Z ret_hu_conv = org.ldk.structs.Option_f64Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + if (this != null) { this.ptrs_to.add(target); }; + if (this != null) { this.ptrs_to.add(params); }; + return ret_hu_conv; + } + + /** + * Query the probability of payment success sending the given `amount_msat` over the channel + * with `scid` towards the given `target` node, based on the live estimated liquidity bounds. + * + * This will return `Some` for any channel which is present in the [`NetworkGraph`], including + * if we have no bound information beside the channel's capacity. + */ + public Option_f64Z live_estimated_payment_success_probability(long scid, org.ldk.structs.NodeId target, long amount_msat, org.ldk.structs.ProbabilisticScoringFeeParameters params) { + long ret = bindings.ProbabilisticScorer_live_estimated_payment_success_probability(this.ptr, scid, target.ptr, amount_msat, params.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(scid); Reference.reachabilityFence(target); diff --git a/src/main/java/org/ldk/structs/ProbabilisticScoringDecayParameters.java b/src/main/java/org/ldk/structs/ProbabilisticScoringDecayParameters.java index 323260bd..d401fab3 100644 --- a/src/main/java/org/ldk/structs/ProbabilisticScoringDecayParameters.java +++ b/src/main/java/org/ldk/structs/ProbabilisticScoringDecayParameters.java @@ -76,11 +76,11 @@ public class ProbabilisticScoringDecayParameters extends CommonBase { * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats. * - * Default value: 6 hours + * Default value: 30 minutes * * # Note * - * When built with the `no-std` feature, time will never elapse. Therefore, the channel + * When not built with the `std` feature, time will never elapse. Therefore, the channel * liquidity knowledge will never decay except when the bounds cross. */ public long get_liquidity_offset_half_life() { @@ -103,11 +103,11 @@ public class ProbabilisticScoringDecayParameters extends CommonBase { * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats. * - * Default value: 6 hours + * Default value: 30 minutes * * # Note * - * When built with the `no-std` feature, time will never elapse. Therefore, the channel + * When not built with the `std` feature, time will never elapse. Therefore, the channel * liquidity knowledge will never decay except when the bounds cross. */ public void set_liquidity_offset_half_life(long val) { diff --git a/src/main/java/org/ldk/structs/ProbabilisticScoringFeeParameters.java b/src/main/java/org/ldk/structs/ProbabilisticScoringFeeParameters.java index 560c7ad6..f84eaa9c 100644 --- a/src/main/java/org/ldk/structs/ProbabilisticScoringFeeParameters.java +++ b/src/main/java/org/ldk/structs/ProbabilisticScoringFeeParameters.java @@ -29,7 +29,13 @@ public class ProbabilisticScoringFeeParameters extends CommonBase { /** * A fixed penalty in msats to apply to each channel. * - * Default value: 500 msat + * In testing, a value of roughly 1/10th of [`historical_liquidity_penalty_multiplier_msat`] + * (implying scaling all estimated probabilities down by a factor of ~79%) resulted in the + * most accurate total success probabilities. + * + * Default value: 1,024 msat (i.e. we're willing to pay 1 sat to avoid each additional hop). + * + * [`historical_liquidity_penalty_multiplier_msat`]: Self::historical_liquidity_penalty_multiplier_msat */ public long get_base_penalty_msat() { long ret = bindings.ProbabilisticScoringFeeParameters_get_base_penalty_msat(this.ptr); @@ -40,7 +46,13 @@ public class ProbabilisticScoringFeeParameters extends CommonBase { /** * A fixed penalty in msats to apply to each channel. * - * Default value: 500 msat + * In testing, a value of roughly 1/10th of [`historical_liquidity_penalty_multiplier_msat`] + * (implying scaling all estimated probabilities down by a factor of ~79%) resulted in the + * most accurate total success probabilities. + * + * Default value: 1,024 msat (i.e. we're willing to pay 1 sat to avoid each additional hop). + * + * [`historical_liquidity_penalty_multiplier_msat`]: Self::historical_liquidity_penalty_multiplier_msat */ public void set_base_penalty_msat(long val) { bindings.ProbabilisticScoringFeeParameters_set_base_penalty_msat(this.ptr, val); @@ -49,19 +61,25 @@ public class ProbabilisticScoringFeeParameters extends CommonBase { } /** - * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty - * applied to each channel, in excess of the [`base_penalty_msat`]. + * A multiplier used with the payment amount to calculate a fixed penalty applied to each + * channel, in excess of the [`base_penalty_msat`]. * * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e., * fees plus penalty) for large payments. The penalty is computed as the product of this - * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment - * amount plus the amount of any other HTLCs flowing we sent over the same channel). + * multiplier and `2^30`ths of the payment amount. * * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30` * - * Default value: 8,192 msat + * In testing, a value of roughly ~100x (1/10th * 2^10) of + * [`historical_liquidity_penalty_amount_multiplier_msat`] (implying scaling all estimated + * probabilities down by a factor of ~79%) resulted in the most accurate total success + * probabilities. + * + * Default value: 131,072 msat (i.e. we're willing to pay 0.125bps to avoid each additional + * hop). * * [`base_penalty_msat`]: Self::base_penalty_msat + * [`historical_liquidity_penalty_amount_multiplier_msat`]: Self::historical_liquidity_penalty_amount_multiplier_msat */ public long get_base_penalty_amount_multiplier_msat() { long ret = bindings.ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(this.ptr); @@ -70,19 +88,25 @@ public class ProbabilisticScoringFeeParameters extends CommonBase { } /** - * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty - * applied to each channel, in excess of the [`base_penalty_msat`]. + * A multiplier used with the payment amount to calculate a fixed penalty applied to each + * channel, in excess of the [`base_penalty_msat`]. * * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e., * fees plus penalty) for large payments. The penalty is computed as the product of this - * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment - * amount plus the amount of any other HTLCs flowing we sent over the same channel). + * multiplier and `2^30`ths of the payment amount. * * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30` * - * Default value: 8,192 msat + * In testing, a value of roughly ~100x (1/10th * 2^10) of + * [`historical_liquidity_penalty_amount_multiplier_msat`] (implying scaling all estimated + * probabilities down by a factor of ~79%) resulted in the most accurate total success + * probabilities. + * + * Default value: 131,072 msat (i.e. we're willing to pay 0.125bps to avoid each additional + * hop). * * [`base_penalty_msat`]: Self::base_penalty_msat + * [`historical_liquidity_penalty_amount_multiplier_msat`]: Self::historical_liquidity_penalty_amount_multiplier_msat */ public void set_base_penalty_amount_multiplier_msat(long val) { bindings.ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(this.ptr, val); @@ -104,9 +128,14 @@ public class ProbabilisticScoringFeeParameters extends CommonBase { * * `-log10(success_probability) * liquidity_penalty_multiplier_msat` * - * Default value: 30,000 msat + * In testing, this scoring model performs much worse than the historical scoring model + * configured with the [`historical_liquidity_penalty_multiplier_msat`] and thus is disabled + * by default. + * + * Default value: 0 msat * * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life + * [`historical_liquidity_penalty_multiplier_msat`]: Self::historical_liquidity_penalty_multiplier_msat */ public long get_liquidity_penalty_multiplier_msat() { long ret = bindings.ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(this.ptr); @@ -128,9 +157,14 @@ public class ProbabilisticScoringFeeParameters extends CommonBase { * * `-log10(success_probability) * liquidity_penalty_multiplier_msat` * - * Default value: 30,000 msat + * In testing, this scoring model performs much worse than the historical scoring model + * configured with the [`historical_liquidity_penalty_multiplier_msat`] and thus is disabled + * by default. + * + * Default value: 0 msat * * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life + * [`historical_liquidity_penalty_multiplier_msat`]: Self::historical_liquidity_penalty_multiplier_msat */ public void set_liquidity_penalty_multiplier_msat(long val) { bindings.ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(this.ptr, val); @@ -139,14 +173,14 @@ public class ProbabilisticScoringFeeParameters extends CommonBase { } /** - * A multiplier used in conjunction with the total amount flowing over a channel and the - * negative `log10` of the channel's success probability for the payment, as determined by our - * latest estimates of the channel's liquidity, to determine the amount penalty. + * A multiplier used in conjunction with the payment amount and the negative `log10` of the + * channel's success probability for the total amount flowing over a channel, as determined by + * our latest estimates of the channel's liquidity, to determine the amount penalty. * * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e., * fees plus penalty) for large payments. The penalty is computed as the product of this - * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative - * `log10` of the success probability. + * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the + * success probability. * * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20` * @@ -156,7 +190,13 @@ public class ProbabilisticScoringFeeParameters extends CommonBase { * probabilities, the multiplier will have a decreasing effect as the negative `log10` will * fall below `1`. * - * Default value: 192 msat + * In testing, this scoring model performs much worse than the historical scoring model + * configured with the [`historical_liquidity_penalty_amount_multiplier_msat`] and thus is + * disabled by default. + * + * Default value: 0 msat + * + * [`historical_liquidity_penalty_amount_multiplier_msat`]: Self::historical_liquidity_penalty_amount_multiplier_msat */ public long get_liquidity_penalty_amount_multiplier_msat() { long ret = bindings.ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(this.ptr); @@ -165,14 +205,14 @@ public class ProbabilisticScoringFeeParameters extends CommonBase { } /** - * A multiplier used in conjunction with the total amount flowing over a channel and the - * negative `log10` of the channel's success probability for the payment, as determined by our - * latest estimates of the channel's liquidity, to determine the amount penalty. + * A multiplier used in conjunction with the payment amount and the negative `log10` of the + * channel's success probability for the total amount flowing over a channel, as determined by + * our latest estimates of the channel's liquidity, to determine the amount penalty. * * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e., * fees plus penalty) for large payments. The penalty is computed as the product of this - * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative - * `log10` of the success probability. + * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the + * success probability. * * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20` * @@ -182,7 +222,13 @@ public class ProbabilisticScoringFeeParameters extends CommonBase { * probabilities, the multiplier will have a decreasing effect as the negative `log10` will * fall below `1`. * - * Default value: 192 msat + * In testing, this scoring model performs much worse than the historical scoring model + * configured with the [`historical_liquidity_penalty_amount_multiplier_msat`] and thus is + * disabled by default. + * + * Default value: 0 msat + * + * [`historical_liquidity_penalty_amount_multiplier_msat`]: Self::historical_liquidity_penalty_amount_multiplier_msat */ public void set_liquidity_penalty_amount_multiplier_msat(long val) { bindings.ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(this.ptr, val); @@ -202,7 +248,8 @@ public class ProbabilisticScoringFeeParameters extends CommonBase { * track which of several buckets those bounds fall into, exponentially decaying the * probability of each bucket as new samples are added. * - * Default value: 10,000 msat + * Default value: 10,000 msat (i.e. willing to pay 1 sat to avoid an 80% probability channel, + * or 6 sats to avoid a 25% probability channel). * * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat */ @@ -224,7 +271,8 @@ public class ProbabilisticScoringFeeParameters extends CommonBase { * track which of several buckets those bounds fall into, exponentially decaying the * probability of each bucket as new samples are added. * - * Default value: 10,000 msat + * Default value: 10,000 msat (i.e. willing to pay 1 sat to avoid an 80% probability channel, + * or 6 sats to avoid a 25% probability channel). * * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat */ @@ -235,15 +283,14 @@ public class ProbabilisticScoringFeeParameters extends CommonBase { } /** - * A multiplier used in conjunction with the total amount flowing over a channel and the - * negative `log10` of the channel's success probability for the payment, as determined based - * on the history of our estimates of the channel's available liquidity, to determine a + * A multiplier used in conjunction with the payment amount and the negative `log10` of the + * channel's success probability for the total amount flowing over a channel, as determined + * based on the history of our estimates of the channel's available liquidity, to determine a * penalty. * * The purpose of the amount penalty is to avoid having fees dominate the channel cost for * large payments. The penalty is computed as the product of this multiplier and `2^20`ths - * of the amount flowing over this channel, weighted by the negative `log10` of the success - * probability. + * of the payment amount, weighted by the negative `log10` of the success probability. * * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead * of using only our latest estimate for the current liquidity available in the channel, it @@ -252,7 +299,9 @@ public class ProbabilisticScoringFeeParameters extends CommonBase { * channel, we track which of several buckets those bounds fall into, exponentially decaying * the probability of each bucket as new samples are added. * - * Default value: 64 msat + * Default value: 1,250 msat (i.e. willing to pay about 0.125 bps per hop to avoid 78% + * probability channels, or 0.5bps to avoid a 38% probability + * channel). * * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat */ @@ -263,15 +312,14 @@ public class ProbabilisticScoringFeeParameters extends CommonBase { } /** - * A multiplier used in conjunction with the total amount flowing over a channel and the - * negative `log10` of the channel's success probability for the payment, as determined based - * on the history of our estimates of the channel's available liquidity, to determine a + * A multiplier used in conjunction with the payment amount and the negative `log10` of the + * channel's success probability for the total amount flowing over a channel, as determined + * based on the history of our estimates of the channel's available liquidity, to determine a * penalty. * * The purpose of the amount penalty is to avoid having fees dominate the channel cost for * large payments. The penalty is computed as the product of this multiplier and `2^20`ths - * of the amount flowing over this channel, weighted by the negative `log10` of the success - * probability. + * of the payment amount, weighted by the negative `log10` of the success probability. * * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead * of using only our latest estimate for the current liquidity available in the channel, it @@ -280,7 +328,9 @@ public class ProbabilisticScoringFeeParameters extends CommonBase { * channel, we track which of several buckets those bounds fall into, exponentially decaying * the probability of each bucket as new samples are added. * - * Default value: 64 msat + * Default value: 1,250 msat (i.e. willing to pay about 0.125 bps per hop to avoid 78% + * probability channels, or 0.5bps to avoid a 38% probability + * channel). * * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat */ diff --git a/src/main/java/org/ldk/structs/ProbeSendFailure.java b/src/main/java/org/ldk/structs/ProbeSendFailure.java index de005273..f1a26fd0 100644 --- a/src/main/java/org/ldk/structs/ProbeSendFailure.java +++ b/src/main/java/org/ldk/structs/ProbeSendFailure.java @@ -27,8 +27,11 @@ public class ProbeSendFailure extends CommonBase { if (raw_val.getClass() == bindings.LDKProbeSendFailure.RouteNotFound.class) { return new RouteNotFound(ptr, (bindings.LDKProbeSendFailure.RouteNotFound)raw_val); } - if (raw_val.getClass() == bindings.LDKProbeSendFailure.SendingFailed.class) { - return new SendingFailed(ptr, (bindings.LDKProbeSendFailure.SendingFailed)raw_val); + if (raw_val.getClass() == bindings.LDKProbeSendFailure.ParameterError.class) { + return new ParameterError(ptr, (bindings.LDKProbeSendFailure.ParameterError)raw_val); + } + if (raw_val.getClass() == bindings.LDKProbeSendFailure.DuplicateProbe.class) { + return new DuplicateProbe(ptr, (bindings.LDKProbeSendFailure.DuplicateProbe)raw_val); } assert false; return null; // Unreachable without extending the (internal) bindings interface } @@ -42,16 +45,38 @@ public class ProbeSendFailure extends CommonBase { } } /** - * We failed to send the payment probes. + * A parameter which was passed to [`ChannelManager::send_probe`] was invalid, preventing us from + * attempting to send the probe at all. + * + * You can freely resend the probe (with the parameter error fixed). + * + * Because the probe failed outright, no payment tracking is done and no + * [`Event::ProbeFailed`] events will be generated. + * + * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe + * [`Event::ProbeFailed`]: crate::events::Event::ProbeFailed */ - public final static class SendingFailed extends ProbeSendFailure { - public final org.ldk.structs.PaymentSendFailure sending_failed; - private SendingFailed(long ptr, bindings.LDKProbeSendFailure.SendingFailed obj) { + public final static class ParameterError extends ProbeSendFailure { + public final org.ldk.structs.APIError parameter_error; + private ParameterError(long ptr, bindings.LDKProbeSendFailure.ParameterError obj) { + super(null, ptr); + long parameter_error = obj.parameter_error; + org.ldk.structs.APIError parameter_error_hu_conv = org.ldk.structs.APIError.constr_from_ptr(parameter_error); + if (parameter_error_hu_conv != null) { parameter_error_hu_conv.ptrs_to.add(this); }; + this.parameter_error = parameter_error_hu_conv; + } + } + /** + * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not + * yet completed (i.e. generated an [`Event::ProbeSuccessful`] or [`Event::ProbeFailed`]). + * + * [`PaymentId`]: crate::ln::channelmanager::PaymentId + * [`Event::ProbeSuccessful`]: crate::events::Event::ProbeSuccessful + * [`Event::ProbeFailed`]: crate::events::Event::ProbeFailed + */ + public final static class DuplicateProbe extends ProbeSendFailure { + private DuplicateProbe(long ptr, bindings.LDKProbeSendFailure.DuplicateProbe obj) { super(null, ptr); - long sending_failed = obj.sending_failed; - org.ldk.structs.PaymentSendFailure sending_failed_hu_conv = org.ldk.structs.PaymentSendFailure.constr_from_ptr(sending_failed); - if (sending_failed_hu_conv != null) { sending_failed_hu_conv.ptrs_to.add(this); }; - this.sending_failed = sending_failed_hu_conv; } } long clone_ptr() { @@ -84,10 +109,10 @@ public class ProbeSendFailure extends CommonBase { } /** - * Utility method to constructs a new SendingFailed-variant ProbeSendFailure + * Utility method to constructs a new ParameterError-variant ProbeSendFailure */ - public static ProbeSendFailure sending_failed(org.ldk.structs.PaymentSendFailure a) { - long ret = bindings.ProbeSendFailure_sending_failed(a.ptr); + public static ProbeSendFailure parameter_error(org.ldk.structs.APIError a) { + long ret = bindings.ProbeSendFailure_parameter_error(a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ProbeSendFailure ret_hu_conv = org.ldk.structs.ProbeSendFailure.constr_from_ptr(ret); @@ -95,6 +120,17 @@ public class ProbeSendFailure extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new DuplicateProbe-variant ProbeSendFailure + */ + public static ProbeSendFailure duplicate_probe() { + long ret = bindings.ProbeSendFailure_duplicate_probe(); + 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); }; + return ret_hu_conv; + } + /** * Checks if two ProbeSendFailures 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/ReceiveTlvs.java b/src/main/java/org/ldk/structs/ReceiveTlvs.java index fbf438c6..693ee4dd 100644 --- a/src/main/java/org/ldk/structs/ReceiveTlvs.java +++ b/src/main/java/org/ldk/structs/ReceiveTlvs.java @@ -11,6 +11,8 @@ import javax.annotation.Nullable; /** * Data to construct a [`BlindedHop`] for receiving a payment. This payload is custom to LDK and * may not be valid if received by another lightning implementation. + * + * Can only be constructed by calling [`UnauthenticatedReceiveTlvs::authenticate`]. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ReceiveTlvs extends CommonBase { @@ -21,94 +23,32 @@ public class ReceiveTlvs extends CommonBase { if (ptr != 0) { bindings.ReceiveTlvs_free(ptr); } } - /** - * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together. - */ - public byte[] get_payment_secret() { - byte[] ret = bindings.ReceiveTlvs_get_payment_secret(this.ptr); + long clone_ptr() { + long ret = bindings.ReceiveTlvs_clone_ptr(this.ptr); Reference.reachabilityFence(this); return ret; } /** - * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together. - */ - public void set_payment_secret(byte[] val) { - bindings.ReceiveTlvs_set_payment_secret(this.ptr, InternalUtils.check_arr_len(val, 32)); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - - /** - * Constraints for the receiver of this payment. - */ - public PaymentConstraints get_payment_constraints() { - long ret = bindings.ReceiveTlvs_get_payment_constraints(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.PaymentConstraints ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentConstraints(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * Constraints for the receiver of this payment. - */ - public void set_payment_constraints(org.ldk.structs.PaymentConstraints val) { - bindings.ReceiveTlvs_set_payment_constraints(this.ptr, val.ptr); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - - /** - * Context for the receiver of this payment. - */ - public PaymentContext get_payment_context() { - long ret = bindings.ReceiveTlvs_get_payment_context(this.ptr); - Reference.reachabilityFence(this); - 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(this); }; - return ret_hu_conv; - } - - /** - * Context for the receiver of this payment. + * Creates a copy of the ReceiveTlvs */ - public void set_payment_context(org.ldk.structs.PaymentContext val) { - bindings.ReceiveTlvs_set_payment_context(this.ptr, val.ptr); + public ReceiveTlvs clone() { + long ret = bindings.ReceiveTlvs_clone(this.ptr); Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - - /** - * Constructs a new ReceiveTlvs given each field - */ - public static ReceiveTlvs of(byte[] payment_secret_arg, org.ldk.structs.PaymentConstraints payment_constraints_arg, org.ldk.structs.PaymentContext payment_context_arg) { - long ret = bindings.ReceiveTlvs_new(InternalUtils.check_arr_len(payment_secret_arg, 32), payment_constraints_arg.ptr, payment_context_arg.ptr); - Reference.reachabilityFence(payment_secret_arg); - Reference.reachabilityFence(payment_constraints_arg); - Reference.reachabilityFence(payment_context_arg); 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(this); }; return ret_hu_conv; } - long clone_ptr() { - long ret = bindings.ReceiveTlvs_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - /** - * Creates a copy of the ReceiveTlvs + * Returns the underlying TLVs. */ - public ReceiveTlvs clone() { - long ret = bindings.ReceiveTlvs_clone(this.ptr); + public UnauthenticatedReceiveTlvs tlvs() { + long ret = bindings.ReceiveTlvs_tlvs(this.ptr); Reference.reachabilityFence(this); 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); } + org.ldk.structs.UnauthenticatedReceiveTlvs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnauthenticatedReceiveTlvs(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/RecentPaymentDetails.java b/src/main/java/org/ldk/structs/RecentPaymentDetails.java index a035fec6..5bd925f4 100644 --- a/src/main/java/org/ldk/structs/RecentPaymentDetails.java +++ b/src/main/java/org/ldk/structs/RecentPaymentDetails.java @@ -42,8 +42,8 @@ public class RecentPaymentDetails extends CommonBase { */ public final static class AwaitingInvoice extends RecentPaymentDetails { /** - * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify - * a payment and ensure idempotency in LDK. + * A user-provided identifier in [`ChannelManager::pay_for_offer`] used to uniquely identify a + * payment and ensure idempotency in LDK. */ public final byte[] payment_id; private AwaitingInvoice(long ptr, bindings.LDKRecentPaymentDetails.AwaitingInvoice obj) { @@ -56,8 +56,11 @@ public class RecentPaymentDetails extends CommonBase { */ public final static class Pending extends RecentPaymentDetails { /** - * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify - * a payment and ensure idempotency in LDK. + * A user-provided identifier in [`send_payment`] or [`pay_for_offer`] used to uniquely + * identify a payment and ensure idempotency in LDK. + * + * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * [`pay_for_offer`]: crate::ln::channelmanager::ChannelManager::pay_for_offer */ public final byte[] payment_id; /** @@ -84,8 +87,11 @@ public class RecentPaymentDetails extends CommonBase { */ public final static class Fulfilled extends RecentPaymentDetails { /** - * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify - * a payment and ensure idempotency in LDK. + * A user-provided identifier in [`send_payment`] or [`pay_for_offer`] used to uniquely + * identify a payment and ensure idempotency in LDK. + * + * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * [`pay_for_offer`]: crate::ln::channelmanager::ChannelManager::pay_for_offer */ public final byte[] payment_id; /** @@ -109,8 +115,11 @@ public class RecentPaymentDetails extends CommonBase { */ public final static class Abandoned extends RecentPaymentDetails { /** - * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify - * a payment and ensure idempotency in LDK. + * A user-provided identifier in [`send_payment`] or [`pay_for_offer`] used to uniquely + * identify a payment and ensure idempotency in LDK. + * + * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * [`pay_for_offer`]: crate::ln::channelmanager::ChannelManager::pay_for_offer */ public final byte[] payment_id; /** diff --git a/src/main/java/org/ldk/structs/Refund.java b/src/main/java/org/ldk/structs/Refund.java index a9ed2993..ec705025 100644 --- a/src/main/java/org/ldk/structs/Refund.java +++ b/src/main/java/org/ldk/structs/Refund.java @@ -127,9 +127,9 @@ public class Refund extends CommonBase { /** * An unpredictable series of bytes, typically containing information about the derivation of - * [`payer_id`]. + * [`payer_signing_pubkey`]. * - * [`payer_id`]: Self::payer_id + * [`payer_signing_pubkey`]: Self::payer_signing_pubkey */ public byte[] payer_metadata() { byte[] ret = bindings.Refund_payer_metadata(this.ptr); @@ -187,8 +187,8 @@ public class Refund extends CommonBase { * * [`paths`]: Self::paths */ - public byte[] payer_id() { - byte[] ret = bindings.Refund_payer_id(this.ptr); + public byte[] payer_signing_pubkey() { + byte[] ret = bindings.Refund_payer_signing_pubkey(this.ptr); Reference.reachabilityFence(this); return ret; } diff --git a/src/main/java/org/ldk/structs/RefundMaybeWithDerivedMetadataBuilder.java b/src/main/java/org/ldk/structs/RefundMaybeWithDerivedMetadataBuilder.java index 27739841..089bc283 100644 --- a/src/main/java/org/ldk/structs/RefundMaybeWithDerivedMetadataBuilder.java +++ b/src/main/java/org/ldk/structs/RefundMaybeWithDerivedMetadataBuilder.java @@ -43,8 +43,8 @@ public class RefundMaybeWithDerivedMetadataBuilder extends CommonBase { } /** - * Creates a new builder for a refund using the [`Refund::payer_id`] for the public node id to - * send to if no [`Refund::paths`] are set. Otherwise, it may be a transient pubkey. + * Creates a new builder for a refund using the `signing_pubkey` for the public node id to send + * to if no [`Refund::paths`] are set. Otherwise, `signing_pubkey` may be a transient pubkey. * * Additionally, sets the required (empty) [`Refund::description`], [`Refund::payer_metadata`], * and [`Refund::amount_msats`]. @@ -57,10 +57,10 @@ public class RefundMaybeWithDerivedMetadataBuilder extends CommonBase { * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager * [`ChannelManager::create_refund_builder`]: crate::ln::channelmanager::ChannelManager::create_refund_builder */ - public static Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ of(byte[] metadata, byte[] payer_id, long amount_msats) { - long ret = bindings.RefundMaybeWithDerivedMetadataBuilder_new(metadata, InternalUtils.check_arr_len(payer_id, 33), amount_msats); + public static Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ of(byte[] metadata, byte[] signing_pubkey, long amount_msats) { + long ret = bindings.RefundMaybeWithDerivedMetadataBuilder_new(metadata, InternalUtils.check_arr_len(signing_pubkey, 33), amount_msats); Reference.reachabilityFence(metadata); - Reference.reachabilityFence(payer_id); + Reference.reachabilityFence(signing_pubkey); Reference.reachabilityFence(amount_msats); if (ret >= 0 && ret <= 4096) { return null; } Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ret_hu_conv = Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); @@ -86,8 +86,8 @@ public class RefundMaybeWithDerivedMetadataBuilder extends CommonBase { * [`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.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)); + public static Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ deriving_signing_pubkey(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_signing_pubkey(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(nonce); @@ -112,8 +112,8 @@ public class RefundMaybeWithDerivedMetadataBuilder extends CommonBase { } /** - * Sets the [`Refund::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has - * already passed is valid and can be checked for using [`Refund::is_expired`]. + * Sets the [`Refund::absolute_expiry`] as seconds since the Unix epoch. + * Any expiry that has already passed is valid and can be checked for using [`Refund::is_expired`]. * * Successive calls to this method will override the previous setting. */ @@ -138,7 +138,7 @@ public class RefundMaybeWithDerivedMetadataBuilder extends CommonBase { /** * Adds a blinded path to [`Refund::paths`]. Must include at least one path if only connected - * by private channels or if [`Refund::payer_id`] is not a public node id. + * by private channels or if [`Refund::payer_signing_pubkey`] is not a public node id. * * Successive calls to this method will add another blinded path. Caller is responsible for not * adding duplicate paths. diff --git a/src/main/java/org/ldk/structs/ReleaseHeldHtlc.java b/src/main/java/org/ldk/structs/ReleaseHeldHtlc.java index 20803307..28b2ece9 100644 --- a/src/main/java/org/ldk/structs/ReleaseHeldHtlc.java +++ b/src/main/java/org/ldk/structs/ReleaseHeldHtlc.java @@ -20,32 +20,11 @@ public class ReleaseHeldHtlc extends CommonBase { 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); + public static ReleaseHeldHtlc of() { + long ret = bindings.ReleaseHeldHtlc_new(); 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); }; diff --git a/src/main/java/org/ldk/structs/ResponseInstruction.java b/src/main/java/org/ldk/structs/ResponseInstruction.java index 7c8d62b3..b91eb9b3 100644 --- a/src/main/java/org/ldk/structs/ResponseInstruction.java +++ b/src/main/java/org/ldk/structs/ResponseInstruction.java @@ -38,4 +38,18 @@ public class ResponseInstruction extends CommonBase { return ret_hu_conv; } + /** + * Converts this [`ResponseInstruction`] into a [`MessageSendInstructions`] so that it can be + * used to send the response via a normal message sending method. + */ + public MessageSendInstructions into_instructions() { + long ret = bindings.ResponseInstruction_into_instructions(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; + } + } diff --git a/src/main/java/org/ldk/structs/Result_AsyncPaymentsContextDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_AsyncPaymentsContextDecodeErrorZ.java new file mode 100644 index 00000000..19225bd0 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_AsyncPaymentsContextDecodeErrorZ.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_AsyncPaymentsContextDecodeErrorZ extends CommonBase { + private Result_AsyncPaymentsContextDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_AsyncPaymentsContextDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_AsyncPaymentsContextDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_AsyncPaymentsContextDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_AsyncPaymentsContextDecodeErrorZ_is_ok(ptr)) { + return new Result_AsyncPaymentsContextDecodeErrorZ_OK(null, ptr); + } else { + return new Result_AsyncPaymentsContextDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_AsyncPaymentsContextDecodeErrorZ_OK extends Result_AsyncPaymentsContextDecodeErrorZ { + public final AsyncPaymentsContext res; + private Result_AsyncPaymentsContextDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_AsyncPaymentsContextDecodeErrorZ_get_ok(ptr); + org.ldk.structs.AsyncPaymentsContext res_hu_conv = org.ldk.structs.AsyncPaymentsContext.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_AsyncPaymentsContextDecodeErrorZ_Err extends Result_AsyncPaymentsContextDecodeErrorZ { + public final DecodeError err; + private Result_AsyncPaymentsContextDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_AsyncPaymentsContextDecodeErrorZ_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_AsyncPaymentsContextDecodeErrorZ in the success state. + */ + public static Result_AsyncPaymentsContextDecodeErrorZ ok(org.ldk.structs.AsyncPaymentsContext o) { + long ret = bindings.CResult_AsyncPaymentsContextDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_AsyncPaymentsContextDecodeErrorZ ret_hu_conv = Result_AsyncPaymentsContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_AsyncPaymentsContextDecodeErrorZ in the error state. + */ + public static Result_AsyncPaymentsContextDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_AsyncPaymentsContextDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_AsyncPaymentsContextDecodeErrorZ ret_hu_conv = Result_AsyncPaymentsContextDecodeErrorZ.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_AsyncPaymentsContextDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_AsyncPaymentsContextDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_AsyncPaymentsContextDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_AsyncPaymentsContextDecodeErrorZ clone() { + long ret = bindings.CResult_AsyncPaymentsContextDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_AsyncPaymentsContextDecodeErrorZ ret_hu_conv = Result_AsyncPaymentsContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ.java new file mode 100644 index 00000000..87028292 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ.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_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ extends CommonBase { + private Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_free(ptr); ptr = 0; } + } + + static Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_is_ok(ptr)) { + return new Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_OK(null, ptr); + } else { + return new Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_Err(null, ptr); + } + } + public static final class Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_OK extends Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ { + public final TwoTuple_DNSSECQueryDNSResolverContextZ res; + private Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_get_ok(ptr); + TwoTuple_DNSSECQueryDNSResolverContextZ res_hu_conv = new TwoTuple_DNSSECQueryDNSResolverContextZ(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_DNSSECQueryDNSResolverContextZNoneZ_Err extends Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ { + private Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + } + } + + /** + * Creates a new CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ in the success state. + */ + public static Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ ok(org.ldk.structs.TwoTuple_DNSSECQueryDNSResolverContextZ o) { + long ret = bindings.CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ ret_hu_conv = Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ in the error state. + */ + public static Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ err() { + long ret = bindings.CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ ret_hu_conv = Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ.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_DNSSECQueryDNSResolverContextZNoneZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ clone() { + long ret = bindings.CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ ret_hu_conv = Result_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ.constr_from_ptr(ret); + 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 deleted file mode 100644 index 86243bb2..00000000 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.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_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ extends CommonBase { - private Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free(ptr); } super.finalize(); - } - - protected void force_free() { - if (ptr != 0) { bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free(ptr); ptr = 0; } - } - - static Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ constr_from_ptr(long ptr) { - if (bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok(ptr)) { - return new Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_OK(null, ptr); - } else { - return new Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_Err(null, ptr); - } - } - public static final class Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_OK extends Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ { - public final TwoTuple_ThirtyTwoBytesThirtyTwoBytesZ res; - private Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - long res = bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_get_ok(ptr); - TwoTuple_ThirtyTwoBytesThirtyTwoBytesZ res_hu_conv = new TwoTuple_ThirtyTwoBytesThirtyTwoBytesZ(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_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_Err extends Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ { - public final PaymentSendFailure err; - private Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - long err = bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_get_err(ptr); - org.ldk.structs.PaymentSendFailure err_hu_conv = org.ldk.structs.PaymentSendFailure.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_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the success state. - */ - public static Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ok(org.ldk.structs.TwoTuple_ThirtyTwoBytesThirtyTwoBytesZ o) { - long ret = bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(o.ptr); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the error state. - */ - public static Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ err(org.ldk.structs.PaymentSendFailure e) { - long ret = bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_err(e.ptr); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.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_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ clone() { - long ret = bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ.java new file mode 100644 index 00000000..671b2687 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ.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_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ extends CommonBase { + private Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_free(ptr); ptr = 0; } + } + + static Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ constr_from_ptr(long ptr) { + if (bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_is_ok(ptr)) { + return new Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_OK(null, ptr); + } else { + return new Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_Err(null, ptr); + } + } + public static final class Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_OK extends Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ { + public final TwoTuple_ThirtyTwoBytesThirtyTwoBytesZ res; + private Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_get_ok(ptr); + TwoTuple_ThirtyTwoBytesThirtyTwoBytesZ res_hu_conv = new TwoTuple_ThirtyTwoBytesThirtyTwoBytesZ(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_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_Err extends Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ { + public final ProbeSendFailure err; + private Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_get_err(ptr); + org.ldk.structs.ProbeSendFailure err_hu_conv = org.ldk.structs.ProbeSendFailure.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_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ in the success state. + */ + public static Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ ok(org.ldk.structs.TwoTuple_ThirtyTwoBytesThirtyTwoBytesZ o) { + long ret = bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ in the error state. + */ + public static Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ err(org.ldk.structs.ProbeSendFailure e) { + long ret = bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ.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_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ clone() { + long ret = bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_CVec_C3Tuple_StrStrStrZZIOErrorZ.java b/src/main/java/org/ldk/structs/Result_CVec_C3Tuple_StrStrStrZZIOErrorZ.java new file mode 100644 index 00000000..9271152e --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_CVec_C3Tuple_StrStrStrZZIOErrorZ.java @@ -0,0 +1,101 @@ +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_C3Tuple_StrStrStrZZIOErrorZ extends CommonBase { + private Result_CVec_C3Tuple_StrStrStrZZIOErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_free(ptr); ptr = 0; } + } + + static Result_CVec_C3Tuple_StrStrStrZZIOErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_is_ok(ptr)) { + return new Result_CVec_C3Tuple_StrStrStrZZIOErrorZ_OK(null, ptr); + } else { + return new Result_CVec_C3Tuple_StrStrStrZZIOErrorZ_Err(null, ptr); + } + } + public static final class Result_CVec_C3Tuple_StrStrStrZZIOErrorZ_OK extends Result_CVec_C3Tuple_StrStrStrZZIOErrorZ { + public final ThreeTuple_StrStrStrZ[] res; + private Result_CVec_C3Tuple_StrStrStrZZIOErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long[] res = bindings.CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_get_ok(ptr); + int res_conv_23_len = res.length; + ThreeTuple_StrStrStrZ[] res_conv_23_arr = new ThreeTuple_StrStrStrZ[res_conv_23_len]; + for (int x = 0; x < res_conv_23_len; x++) { + long res_conv_23 = res[x]; + ThreeTuple_StrStrStrZ res_conv_23_hu_conv = new ThreeTuple_StrStrStrZ(null, res_conv_23); + if (res_conv_23_hu_conv != null) { res_conv_23_hu_conv.ptrs_to.add(this); }; + res_conv_23_arr[x] = res_conv_23_hu_conv; + } + this.res = res_conv_23_arr; + } + } + + public static final class Result_CVec_C3Tuple_StrStrStrZZIOErrorZ_Err extends Result_CVec_C3Tuple_StrStrStrZZIOErrorZ { + public final IOError err; + private Result_CVec_C3Tuple_StrStrStrZZIOErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + this.err = bindings.CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ in the success state. + */ + public static Result_CVec_C3Tuple_StrStrStrZZIOErrorZ ok(ThreeTuple_StrStrStrZ[] o) { + long ret = bindings.CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_ok(o != null ? Arrays.stream(o).mapToLong(o_conv_23 -> o_conv_23.ptr).toArray() : null); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_C3Tuple_StrStrStrZZIOErrorZ ret_hu_conv = Result_CVec_C3Tuple_StrStrStrZZIOErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ in the error state. + */ + public static Result_CVec_C3Tuple_StrStrStrZZIOErrorZ err(org.ldk.enums.IOError e) { + long ret = bindings.CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_err(e); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_C3Tuple_StrStrStrZZIOErrorZ ret_hu_conv = Result_CVec_C3Tuple_StrStrStrZZIOErrorZ.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_C3Tuple_StrStrStrZZIOErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_CVec_C3Tuple_StrStrStrZZIOErrorZ clone() { + long ret = bindings.CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_C3Tuple_StrStrStrZZIOErrorZ ret_hu_conv = Result_CVec_C3Tuple_StrStrStrZZIOErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_DNSResolverContextDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_DNSResolverContextDecodeErrorZ.java new file mode 100644 index 00000000..74b8fb83 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_DNSResolverContextDecodeErrorZ.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_DNSResolverContextDecodeErrorZ extends CommonBase { + private Result_DNSResolverContextDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_DNSResolverContextDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_DNSResolverContextDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_DNSResolverContextDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_DNSResolverContextDecodeErrorZ_is_ok(ptr)) { + return new Result_DNSResolverContextDecodeErrorZ_OK(null, ptr); + } else { + return new Result_DNSResolverContextDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_DNSResolverContextDecodeErrorZ_OK extends Result_DNSResolverContextDecodeErrorZ { + public final DNSResolverContext res; + private Result_DNSResolverContextDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_DNSResolverContextDecodeErrorZ_get_ok(ptr); + org.ldk.structs.DNSResolverContext res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.DNSResolverContext(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_DNSResolverContextDecodeErrorZ_Err extends Result_DNSResolverContextDecodeErrorZ { + public final DecodeError err; + private Result_DNSResolverContextDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_DNSResolverContextDecodeErrorZ_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_DNSResolverContextDecodeErrorZ in the success state. + */ + public static Result_DNSResolverContextDecodeErrorZ ok(org.ldk.structs.DNSResolverContext o) { + long ret = bindings.CResult_DNSResolverContextDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_DNSResolverContextDecodeErrorZ ret_hu_conv = Result_DNSResolverContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_DNSResolverContextDecodeErrorZ in the error state. + */ + public static Result_DNSResolverContextDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_DNSResolverContextDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_DNSResolverContextDecodeErrorZ ret_hu_conv = Result_DNSResolverContextDecodeErrorZ.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_DNSResolverContextDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_DNSResolverContextDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_DNSResolverContextDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_DNSResolverContextDecodeErrorZ clone() { + long ret = bindings.CResult_DNSResolverContextDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_DNSResolverContextDecodeErrorZ ret_hu_conv = Result_DNSResolverContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_DNSResolverMessageDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_DNSResolverMessageDecodeErrorZ.java new file mode 100644 index 00000000..10782dc8 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_DNSResolverMessageDecodeErrorZ.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_DNSResolverMessageDecodeErrorZ extends CommonBase { + private Result_DNSResolverMessageDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_DNSResolverMessageDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_DNSResolverMessageDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_DNSResolverMessageDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_DNSResolverMessageDecodeErrorZ_is_ok(ptr)) { + return new Result_DNSResolverMessageDecodeErrorZ_OK(null, ptr); + } else { + return new Result_DNSResolverMessageDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_DNSResolverMessageDecodeErrorZ_OK extends Result_DNSResolverMessageDecodeErrorZ { + public final DNSResolverMessage res; + private Result_DNSResolverMessageDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_DNSResolverMessageDecodeErrorZ_get_ok(ptr); + org.ldk.structs.DNSResolverMessage res_hu_conv = org.ldk.structs.DNSResolverMessage.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_DNSResolverMessageDecodeErrorZ_Err extends Result_DNSResolverMessageDecodeErrorZ { + public final DecodeError err; + private Result_DNSResolverMessageDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_DNSResolverMessageDecodeErrorZ_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_DNSResolverMessageDecodeErrorZ in the success state. + */ + public static Result_DNSResolverMessageDecodeErrorZ ok(org.ldk.structs.DNSResolverMessage o) { + long ret = bindings.CResult_DNSResolverMessageDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_DNSResolverMessageDecodeErrorZ ret_hu_conv = Result_DNSResolverMessageDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_DNSResolverMessageDecodeErrorZ in the error state. + */ + public static Result_DNSResolverMessageDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_DNSResolverMessageDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_DNSResolverMessageDecodeErrorZ ret_hu_conv = Result_DNSResolverMessageDecodeErrorZ.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_DNSResolverMessageDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_DNSResolverMessageDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_DNSResolverMessageDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_DNSResolverMessageDecodeErrorZ clone() { + long ret = bindings.CResult_DNSResolverMessageDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_DNSResolverMessageDecodeErrorZ ret_hu_conv = Result_DNSResolverMessageDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_HumanReadableNameDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HumanReadableNameDecodeErrorZ.java new file mode 100644 index 00000000..b6a811c9 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_HumanReadableNameDecodeErrorZ.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_HumanReadableNameDecodeErrorZ extends CommonBase { + private Result_HumanReadableNameDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_HumanReadableNameDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_HumanReadableNameDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_HumanReadableNameDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_HumanReadableNameDecodeErrorZ_is_ok(ptr)) { + return new Result_HumanReadableNameDecodeErrorZ_OK(null, ptr); + } else { + return new Result_HumanReadableNameDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_HumanReadableNameDecodeErrorZ_OK extends Result_HumanReadableNameDecodeErrorZ { + public final HumanReadableName res; + private Result_HumanReadableNameDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_HumanReadableNameDecodeErrorZ_get_ok(ptr); + org.ldk.structs.HumanReadableName res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.HumanReadableName(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_HumanReadableNameDecodeErrorZ_Err extends Result_HumanReadableNameDecodeErrorZ { + public final DecodeError err; + private Result_HumanReadableNameDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_HumanReadableNameDecodeErrorZ_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_HumanReadableNameDecodeErrorZ in the success state. + */ + public static Result_HumanReadableNameDecodeErrorZ ok(org.ldk.structs.HumanReadableName o) { + long ret = bindings.CResult_HumanReadableNameDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HumanReadableNameDecodeErrorZ ret_hu_conv = Result_HumanReadableNameDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_HumanReadableNameDecodeErrorZ in the error state. + */ + public static Result_HumanReadableNameDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_HumanReadableNameDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HumanReadableNameDecodeErrorZ ret_hu_conv = Result_HumanReadableNameDecodeErrorZ.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_HumanReadableNameDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_HumanReadableNameDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_HumanReadableNameDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_HumanReadableNameDecodeErrorZ clone() { + long ret = bindings.CResult_HumanReadableNameDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HumanReadableNameDecodeErrorZ ret_hu_conv = Result_HumanReadableNameDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_HumanReadableNameNoneZ.java b/src/main/java/org/ldk/structs/Result_HumanReadableNameNoneZ.java new file mode 100644 index 00000000..b517ee0e --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_HumanReadableNameNoneZ.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_HumanReadableNameNoneZ extends CommonBase { + private Result_HumanReadableNameNoneZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_HumanReadableNameNoneZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_HumanReadableNameNoneZ_free(ptr); ptr = 0; } + } + + static Result_HumanReadableNameNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_HumanReadableNameNoneZ_is_ok(ptr)) { + return new Result_HumanReadableNameNoneZ_OK(null, ptr); + } else { + return new Result_HumanReadableNameNoneZ_Err(null, ptr); + } + } + public static final class Result_HumanReadableNameNoneZ_OK extends Result_HumanReadableNameNoneZ { + public final HumanReadableName res; + private Result_HumanReadableNameNoneZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_HumanReadableNameNoneZ_get_ok(ptr); + org.ldk.structs.HumanReadableName res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.HumanReadableName(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_HumanReadableNameNoneZ_Err extends Result_HumanReadableNameNoneZ { + private Result_HumanReadableNameNoneZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + } + } + + /** + * Creates a new CResult_HumanReadableNameNoneZ in the success state. + */ + public static Result_HumanReadableNameNoneZ ok(org.ldk.structs.HumanReadableName o) { + long ret = bindings.CResult_HumanReadableNameNoneZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HumanReadableNameNoneZ ret_hu_conv = Result_HumanReadableNameNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_HumanReadableNameNoneZ in the error state. + */ + public static Result_HumanReadableNameNoneZ err() { + long ret = bindings.CResult_HumanReadableNameNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HumanReadableNameNoneZ ret_hu_conv = Result_HumanReadableNameNoneZ.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_HumanReadableNameNoneZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_HumanReadableNameNoneZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_HumanReadableNameNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_HumanReadableNameNoneZ clone() { + long ret = bindings.CResult_HumanReadableNameNoneZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_HumanReadableNameNoneZ ret_hu_conv = Result_HumanReadableNameNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_InvoiceRequestDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceRequestDecodeErrorZ.java new file mode 100644 index 00000000..e97c5ab6 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_InvoiceRequestDecodeErrorZ.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_InvoiceRequestDecodeErrorZ extends CommonBase { + private Result_InvoiceRequestDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_InvoiceRequestDecodeErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_InvoiceRequestDecodeErrorZ_free(ptr); ptr = 0; } + } + + static Result_InvoiceRequestDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_InvoiceRequestDecodeErrorZ_is_ok(ptr)) { + return new Result_InvoiceRequestDecodeErrorZ_OK(null, ptr); + } else { + return new Result_InvoiceRequestDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_InvoiceRequestDecodeErrorZ_OK extends Result_InvoiceRequestDecodeErrorZ { + public final InvoiceRequest res; + private Result_InvoiceRequestDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_InvoiceRequestDecodeErrorZ_get_ok(ptr); + org.ldk.structs.InvoiceRequest res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InvoiceRequest(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_InvoiceRequestDecodeErrorZ_Err extends Result_InvoiceRequestDecodeErrorZ { + public final DecodeError err; + private Result_InvoiceRequestDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_InvoiceRequestDecodeErrorZ_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_InvoiceRequestDecodeErrorZ in the success state. + */ + public static Result_InvoiceRequestDecodeErrorZ ok(org.ldk.structs.InvoiceRequest o) { + long ret = bindings.CResult_InvoiceRequestDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestDecodeErrorZ ret_hu_conv = Result_InvoiceRequestDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_InvoiceRequestDecodeErrorZ in the error state. + */ + public static Result_InvoiceRequestDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_InvoiceRequestDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestDecodeErrorZ ret_hu_conv = Result_InvoiceRequestDecodeErrorZ.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_InvoiceRequestDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_InvoiceRequestDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_InvoiceRequestDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_InvoiceRequestDecodeErrorZ clone() { + long ret = bindings.CResult_InvoiceRequestDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestDecodeErrorZ ret_hu_conv = Result_InvoiceRequestDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.java deleted file mode 100644 index e25fd5fc..00000000 --- a/src/main/java/org/ldk/structs/Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.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; - -public class Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ extends CommonBase { - private Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(ptr); } super.finalize(); - } - - protected void force_free() { - if (ptr != 0) { bindings.CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(ptr); ptr = 0; } - } - - static Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(ptr)) { - return new Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_OK(null, ptr); - } else { - return new Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_Err(null, ptr); - } - } - public static final class Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_OK extends Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ { - public final InvoiceRequestWithDerivedPayerIdBuilder res; - private Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - long res = bindings.CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(ptr); - org.ldk.structs.InvoiceRequestWithDerivedPayerIdBuilder res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InvoiceRequestWithDerivedPayerIdBuilder(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; - this.res = res_hu_conv; - } - } - - public static final class Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_Err extends Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ { - public final Bolt12SemanticError err; - private Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - this.err = bindings.CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err(ptr); - } - } - - /** - * Creates a new CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ in the success state. - */ - public static Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ ok(org.ldk.structs.InvoiceRequestWithDerivedPayerIdBuilder o) { - long ret = bindings.CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(o.ptr); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; - // Due to rust's strict-ownership memory model, in some cases we need to "move" - // an object to pass exclusive ownership to the function being called. - // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object - // at the FFI layer, creating a new object which Rust can claim ownership of - // However, in some cases (eg here), there is no way to clone an object, and thus - // we actually have to pass full ownership to Rust. - // Thus, after ret_hu_conv call, o is reset to null and is now a dummy object. - o.ptr = 0;; - return ret_hu_conv; - } - - /** - * Creates a new CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ in the error state. - */ - public static Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ err(org.ldk.enums.Bolt12SemanticError e) { - long ret = bindings.CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(e); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.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_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ.java new file mode 100644 index 00000000..8fe46ac7 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ.java @@ -0,0 +1,86 @@ +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_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ extends CommonBase { + private Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_free(ptr); ptr = 0; } + } + + static Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(ptr)) { + return new Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_OK(null, ptr); + } else { + return new Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_Err(null, ptr); + } + } + public static final class Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_OK extends Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ { + public final InvoiceRequestWithDerivedPayerSigningPubkeyBuilder res; + private Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(ptr); + org.ldk.structs.InvoiceRequestWithDerivedPayerSigningPubkeyBuilder res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InvoiceRequestWithDerivedPayerSigningPubkeyBuilder(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_Err extends Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ { + public final Bolt12SemanticError err; + private Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + this.err = bindings.CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ in the success state. + */ + public static Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ ok(org.ldk.structs.InvoiceRequestWithDerivedPayerSigningPubkeyBuilder o) { + long ret = bindings.CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after ret_hu_conv call, o is reset to null and is now a dummy object. + o.ptr = 0;; + return ret_hu_conv; + } + + /** + * Creates a new CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ in the error state. + */ + public static Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ err(org.ldk.enums.Bolt12SemanticError e) { + long ret = bindings.CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_err(e); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ.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_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.java deleted file mode 100644 index 9e7a22bb..00000000 --- a/src/main/java/org/ldk/structs/Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.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; - -public class Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ extends CommonBase { - private Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(ptr); } super.finalize(); - } - - protected void force_free() { - if (ptr != 0) { bindings.CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(ptr); ptr = 0; } - } - - static Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(ptr)) { - return new Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_OK(null, ptr); - } else { - return new Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_Err(null, ptr); - } - } - public static final class Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_OK extends Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ { - public final InvoiceRequestWithExplicitPayerIdBuilder res; - private Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - long res = bindings.CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok(ptr); - org.ldk.structs.InvoiceRequestWithExplicitPayerIdBuilder res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InvoiceRequestWithExplicitPayerIdBuilder(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; - this.res = res_hu_conv; - } - } - - public static final class Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_Err extends Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ { - public final Bolt12SemanticError err; - private Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - this.err = bindings.CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err(ptr); - } - } - - /** - * Creates a new CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ in the success state. - */ - public static Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ ok(org.ldk.structs.InvoiceRequestWithExplicitPayerIdBuilder o) { - long ret = bindings.CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(o.ptr); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; - // Due to rust's strict-ownership memory model, in some cases we need to "move" - // an object to pass exclusive ownership to the function being called. - // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object - // at the FFI layer, creating a new object which Rust can claim ownership of - // However, in some cases (eg here), there is no way to clone an object, and thus - // we actually have to pass full ownership to Rust. - // Thus, after ret_hu_conv call, o is reset to null and is now a dummy object. - o.ptr = 0;; - return ret_hu_conv; - } - - /** - * Creates a new CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ in the error state. - */ - public static Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ err(org.ldk.enums.Bolt12SemanticError e) { - long ret = bindings.CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(e); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.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_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_MonitorNameIOErrorZ.java b/src/main/java/org/ldk/structs/Result_MonitorNameIOErrorZ.java new file mode 100644 index 00000000..1e7c7d05 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_MonitorNameIOErrorZ.java @@ -0,0 +1,86 @@ +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_MonitorNameIOErrorZ extends CommonBase { + private Result_MonitorNameIOErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_MonitorNameIOErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_MonitorNameIOErrorZ_free(ptr); ptr = 0; } + } + + static Result_MonitorNameIOErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_MonitorNameIOErrorZ_is_ok(ptr)) { + return new Result_MonitorNameIOErrorZ_OK(null, ptr); + } else { + return new Result_MonitorNameIOErrorZ_Err(null, ptr); + } + } + public static final class Result_MonitorNameIOErrorZ_OK extends Result_MonitorNameIOErrorZ { + public final MonitorName res; + private Result_MonitorNameIOErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_MonitorNameIOErrorZ_get_ok(ptr); + org.ldk.structs.MonitorName res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.MonitorName(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_MonitorNameIOErrorZ_Err extends Result_MonitorNameIOErrorZ { + public final IOError err; + private Result_MonitorNameIOErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + this.err = bindings.CResult_MonitorNameIOErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_MonitorNameIOErrorZ in the success state. + */ + public static Result_MonitorNameIOErrorZ ok(org.ldk.structs.MonitorName o) { + long ret = bindings.CResult_MonitorNameIOErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_MonitorNameIOErrorZ ret_hu_conv = Result_MonitorNameIOErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after ret_hu_conv call, o is reset to null and is now a dummy object. + o.ptr = 0;; + return ret_hu_conv; + } + + /** + * Creates a new CResult_MonitorNameIOErrorZ in the error state. + */ + public static Result_MonitorNameIOErrorZ err(org.ldk.enums.IOError e) { + long ret = bindings.CResult_MonitorNameIOErrorZ_err(e); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_MonitorNameIOErrorZ ret_hu_conv = Result_MonitorNameIOErrorZ.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_MonitorNameIOErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_NoneBolt12PaymentErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneBolt12PaymentErrorZ.java new file mode 100644 index 00000000..26c591c6 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_NoneBolt12PaymentErrorZ.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_NoneBolt12PaymentErrorZ extends CommonBase { + private Result_NoneBolt12PaymentErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_NoneBolt12PaymentErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_NoneBolt12PaymentErrorZ_free(ptr); ptr = 0; } + } + + static Result_NoneBolt12PaymentErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_NoneBolt12PaymentErrorZ_is_ok(ptr)) { + return new Result_NoneBolt12PaymentErrorZ_OK(null, ptr); + } else { + return new Result_NoneBolt12PaymentErrorZ_Err(null, ptr); + } + } + public static final class Result_NoneBolt12PaymentErrorZ_OK extends Result_NoneBolt12PaymentErrorZ { + private Result_NoneBolt12PaymentErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + } + } + + public static final class Result_NoneBolt12PaymentErrorZ_Err extends Result_NoneBolt12PaymentErrorZ { + public final Bolt12PaymentError err; + private Result_NoneBolt12PaymentErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_NoneBolt12PaymentErrorZ_get_err(ptr); + org.ldk.structs.Bolt12PaymentError err_hu_conv = org.ldk.structs.Bolt12PaymentError.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_NoneBolt12PaymentErrorZ in the success state. + */ + public static Result_NoneBolt12PaymentErrorZ ok() { + long ret = bindings.CResult_NoneBolt12PaymentErrorZ_ok(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneBolt12PaymentErrorZ ret_hu_conv = Result_NoneBolt12PaymentErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NoneBolt12PaymentErrorZ in the error state. + */ + public static Result_NoneBolt12PaymentErrorZ err(org.ldk.structs.Bolt12PaymentError e) { + long ret = bindings.CResult_NoneBolt12PaymentErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneBolt12PaymentErrorZ ret_hu_conv = Result_NoneBolt12PaymentErrorZ.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_NoneBolt12PaymentErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NoneBolt12PaymentErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_NoneBolt12PaymentErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NoneBolt12PaymentErrorZ clone() { + long ret = bindings.CResult_NoneBolt12PaymentErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneBolt12PaymentErrorZ ret_hu_conv = Result_NoneBolt12PaymentErrorZ.constr_from_ptr(ret); + 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 deleted file mode 100644 index a6903026..00000000 --- a/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.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_NonePaymentSendFailureZ extends CommonBase { - private Result_NonePaymentSendFailureZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_NonePaymentSendFailureZ_free(ptr); } super.finalize(); - } - - protected void force_free() { - if (ptr != 0) { bindings.CResult_NonePaymentSendFailureZ_free(ptr); ptr = 0; } - } - - static Result_NonePaymentSendFailureZ constr_from_ptr(long ptr) { - if (bindings.CResult_NonePaymentSendFailureZ_is_ok(ptr)) { - return new Result_NonePaymentSendFailureZ_OK(null, ptr); - } else { - return new Result_NonePaymentSendFailureZ_Err(null, ptr); - } - } - public static final class Result_NonePaymentSendFailureZ_OK extends Result_NonePaymentSendFailureZ { - private Result_NonePaymentSendFailureZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - } - } - - public static final class Result_NonePaymentSendFailureZ_Err extends Result_NonePaymentSendFailureZ { - public final PaymentSendFailure err; - private Result_NonePaymentSendFailureZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - long err = bindings.CResult_NonePaymentSendFailureZ_get_err(ptr); - org.ldk.structs.PaymentSendFailure err_hu_conv = org.ldk.structs.PaymentSendFailure.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_NonePaymentSendFailureZ in the success state. - */ - public static Result_NonePaymentSendFailureZ ok() { - long ret = bindings.CResult_NonePaymentSendFailureZ_ok(); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_NonePaymentSendFailureZ in the error state. - */ - public static Result_NonePaymentSendFailureZ err(org.ldk.structs.PaymentSendFailure e) { - long ret = bindings.CResult_NonePaymentSendFailureZ_err(e.ptr); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.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_NonePaymentSendFailureZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_NonePaymentSendFailureZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_NonePaymentSendFailureZ clone() { - long ret = bindings.CResult_NonePaymentSendFailureZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); - 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 312b71d0..7e495921 100644 --- a/src/main/java/org/ldk/structs/Result_SiPrefixBolt11ParseErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SiPrefixBolt11ParseErrorZ.java @@ -37,7 +37,7 @@ public class Result_SiPrefixBolt11ParseErrorZ extends CommonBase { private Result_SiPrefixBolt11ParseErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_SiPrefixBolt11ParseErrorZ_get_err(ptr); - org.ldk.structs.Bolt11ParseError err_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(err); + org.ldk.structs.Bolt11ParseError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.Bolt11ParseError(null, err); } if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; this.err = err_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 3c875773..759b4e63 100644 --- a/src/main/java/org/ldk/structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.java @@ -40,7 +40,7 @@ public class Result_SignedRawBolt11InvoiceBolt11ParseErrorZ extends CommonBase { private Result_SignedRawBolt11InvoiceBolt11ParseErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_get_err(ptr); - org.ldk.structs.Bolt11ParseError err_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(err); + org.ldk.structs.Bolt11ParseError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.Bolt11ParseError(null, err); } if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ThirtyTwoBytesPaymentSendFailureZ.java b/src/main/java/org/ldk/structs/Result_ThirtyTwoBytesPaymentSendFailureZ.java deleted file mode 100644 index 0ae09cd1..00000000 --- a/src/main/java/org/ldk/structs/Result_ThirtyTwoBytesPaymentSendFailureZ.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; - -public class Result_ThirtyTwoBytesPaymentSendFailureZ extends CommonBase { - private Result_ThirtyTwoBytesPaymentSendFailureZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_ThirtyTwoBytesPaymentSendFailureZ_free(ptr); } super.finalize(); - } - - protected void force_free() { - if (ptr != 0) { bindings.CResult_ThirtyTwoBytesPaymentSendFailureZ_free(ptr); ptr = 0; } - } - - static Result_ThirtyTwoBytesPaymentSendFailureZ constr_from_ptr(long ptr) { - if (bindings.CResult_ThirtyTwoBytesPaymentSendFailureZ_is_ok(ptr)) { - return new Result_ThirtyTwoBytesPaymentSendFailureZ_OK(null, ptr); - } else { - return new Result_ThirtyTwoBytesPaymentSendFailureZ_Err(null, ptr); - } - } - public static final class Result_ThirtyTwoBytesPaymentSendFailureZ_OK extends Result_ThirtyTwoBytesPaymentSendFailureZ { - public final byte[] res; - private Result_ThirtyTwoBytesPaymentSendFailureZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - this.res = bindings.CResult_ThirtyTwoBytesPaymentSendFailureZ_get_ok(ptr); - } - } - - public static final class Result_ThirtyTwoBytesPaymentSendFailureZ_Err extends Result_ThirtyTwoBytesPaymentSendFailureZ { - public final PaymentSendFailure err; - private Result_ThirtyTwoBytesPaymentSendFailureZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - long err = bindings.CResult_ThirtyTwoBytesPaymentSendFailureZ_get_err(ptr); - org.ldk.structs.PaymentSendFailure err_hu_conv = org.ldk.structs.PaymentSendFailure.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_ThirtyTwoBytesPaymentSendFailureZ in the success state. - */ - public static Result_ThirtyTwoBytesPaymentSendFailureZ ok(byte[] o) { - long ret = bindings.CResult_ThirtyTwoBytesPaymentSendFailureZ_ok(InternalUtils.check_arr_len(o, 32)); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_ThirtyTwoBytesPaymentSendFailureZ ret_hu_conv = Result_ThirtyTwoBytesPaymentSendFailureZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the error state. - */ - public static Result_ThirtyTwoBytesPaymentSendFailureZ err(org.ldk.structs.PaymentSendFailure e) { - long ret = bindings.CResult_ThirtyTwoBytesPaymentSendFailureZ_err(e.ptr); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_ThirtyTwoBytesPaymentSendFailureZ ret_hu_conv = Result_ThirtyTwoBytesPaymentSendFailureZ.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_ThirtyTwoBytesPaymentSendFailureZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_ThirtyTwoBytesPaymentSendFailureZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_ThirtyTwoBytesPaymentSendFailureZ clone() { - long ret = bindings.CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_ThirtyTwoBytesPaymentSendFailureZ ret_hu_conv = Result_ThirtyTwoBytesPaymentSendFailureZ.constr_from_ptr(ret); - 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 deleted file mode 100644 index a019c3ad..00000000 --- a/src/main/java/org/ldk/structs/Result_UnknownPaymentContextDecodeErrorZ.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_UnknownPaymentContextDecodeErrorZ extends CommonBase { - private Result_UnknownPaymentContextDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_UnknownPaymentContextDecodeErrorZ_free(ptr); } super.finalize(); - } - - protected void force_free() { - if (ptr != 0) { bindings.CResult_UnknownPaymentContextDecodeErrorZ_free(ptr); ptr = 0; } - } - - static Result_UnknownPaymentContextDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_UnknownPaymentContextDecodeErrorZ_is_ok(ptr)) { - return new Result_UnknownPaymentContextDecodeErrorZ_OK(null, ptr); - } else { - return new Result_UnknownPaymentContextDecodeErrorZ_Err(null, ptr); - } - } - public static final class Result_UnknownPaymentContextDecodeErrorZ_OK extends Result_UnknownPaymentContextDecodeErrorZ { - public final UnknownPaymentContext res; - private Result_UnknownPaymentContextDecodeErrorZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - long res = bindings.CResult_UnknownPaymentContextDecodeErrorZ_get_ok(ptr); - org.ldk.structs.UnknownPaymentContext res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.UnknownPaymentContext(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; - this.res = res_hu_conv; - } - } - - public static final class Result_UnknownPaymentContextDecodeErrorZ_Err extends Result_UnknownPaymentContextDecodeErrorZ { - public final DecodeError err; - private Result_UnknownPaymentContextDecodeErrorZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - long err = bindings.CResult_UnknownPaymentContextDecodeErrorZ_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_UnknownPaymentContextDecodeErrorZ in the success state. - */ - public static Result_UnknownPaymentContextDecodeErrorZ ok(org.ldk.structs.UnknownPaymentContext o) { - long ret = bindings.CResult_UnknownPaymentContextDecodeErrorZ_ok(o.ptr); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_UnknownPaymentContextDecodeErrorZ ret_hu_conv = Result_UnknownPaymentContextDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_UnknownPaymentContextDecodeErrorZ in the error state. - */ - public static Result_UnknownPaymentContextDecodeErrorZ err(org.ldk.structs.DecodeError e) { - long ret = bindings.CResult_UnknownPaymentContextDecodeErrorZ_err(e.ptr); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_UnknownPaymentContextDecodeErrorZ ret_hu_conv = Result_UnknownPaymentContextDecodeErrorZ.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_UnknownPaymentContextDecodeErrorZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_UnknownPaymentContextDecodeErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_UnknownPaymentContextDecodeErrorZ clone() { - long ret = bindings.CResult_UnknownPaymentContextDecodeErrorZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_UnknownPaymentContextDecodeErrorZ ret_hu_conv = Result_UnknownPaymentContextDecodeErrorZ.constr_from_ptr(ret); - 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 deleted file mode 100644 index 9d55da81..00000000 --- a/src/main/java/org/ldk/structs/Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.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; - -public class Result_UnsignedInvoiceRequestBolt12SemanticErrorZ extends CommonBase { - private Result_UnsignedInvoiceRequestBolt12SemanticErrorZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(ptr); } super.finalize(); - } - - protected void force_free() { - if (ptr != 0) { bindings.CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(ptr); ptr = 0; } - } - - static Result_UnsignedInvoiceRequestBolt12SemanticErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(ptr)) { - return new Result_UnsignedInvoiceRequestBolt12SemanticErrorZ_OK(null, ptr); - } else { - return new Result_UnsignedInvoiceRequestBolt12SemanticErrorZ_Err(null, ptr); - } - } - public static final class Result_UnsignedInvoiceRequestBolt12SemanticErrorZ_OK extends Result_UnsignedInvoiceRequestBolt12SemanticErrorZ { - public final UnsignedInvoiceRequest res; - private Result_UnsignedInvoiceRequestBolt12SemanticErrorZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - long res = bindings.CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(ptr); - org.ldk.structs.UnsignedInvoiceRequest res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.UnsignedInvoiceRequest(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; - this.res = res_hu_conv; - } - } - - public static final class Result_UnsignedInvoiceRequestBolt12SemanticErrorZ_Err extends Result_UnsignedInvoiceRequestBolt12SemanticErrorZ { - public final Bolt12SemanticError err; - private Result_UnsignedInvoiceRequestBolt12SemanticErrorZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - this.err = bindings.CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err(ptr); - } - } - - /** - * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ in the success state. - */ - public static Result_UnsignedInvoiceRequestBolt12SemanticErrorZ ok(org.ldk.structs.UnsignedInvoiceRequest o) { - long ret = bindings.CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(o.ptr); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_UnsignedInvoiceRequestBolt12SemanticErrorZ ret_hu_conv = Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ in the error state. - */ - public static Result_UnsignedInvoiceRequestBolt12SemanticErrorZ err(org.ldk.enums.Bolt12SemanticError e) { - long ret = bindings.CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(e); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_UnsignedInvoiceRequestBolt12SemanticErrorZ ret_hu_conv = Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.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_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_UnsignedInvoiceRequestBolt12SemanticErrorZ clone() { - long ret = bindings.CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_UnsignedInvoiceRequestBolt12SemanticErrorZ ret_hu_conv = Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_UpdateNameIOErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateNameIOErrorZ.java new file mode 100644 index 00000000..e26db81a --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_UpdateNameIOErrorZ.java @@ -0,0 +1,86 @@ +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_UpdateNameIOErrorZ extends CommonBase { + private Result_UpdateNameIOErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_UpdateNameIOErrorZ_free(ptr); } super.finalize(); + } + + protected void force_free() { + if (ptr != 0) { bindings.CResult_UpdateNameIOErrorZ_free(ptr); ptr = 0; } + } + + static Result_UpdateNameIOErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_UpdateNameIOErrorZ_is_ok(ptr)) { + return new Result_UpdateNameIOErrorZ_OK(null, ptr); + } else { + return new Result_UpdateNameIOErrorZ_Err(null, ptr); + } + } + public static final class Result_UpdateNameIOErrorZ_OK extends Result_UpdateNameIOErrorZ { + public final UpdateName res; + private Result_UpdateNameIOErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_UpdateNameIOErrorZ_get_ok(ptr); + org.ldk.structs.UpdateName res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.UpdateName(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_UpdateNameIOErrorZ_Err extends Result_UpdateNameIOErrorZ { + public final IOError err; + private Result_UpdateNameIOErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + this.err = bindings.CResult_UpdateNameIOErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_UpdateNameIOErrorZ in the success state. + */ + public static Result_UpdateNameIOErrorZ ok(org.ldk.structs.UpdateName o) { + long ret = bindings.CResult_UpdateNameIOErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UpdateNameIOErrorZ ret_hu_conv = Result_UpdateNameIOErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after ret_hu_conv call, o is reset to null and is now a dummy object. + o.ptr = 0;; + return ret_hu_conv; + } + + /** + * Creates a new CResult_UpdateNameIOErrorZ in the error state. + */ + public static Result_UpdateNameIOErrorZ err(org.ldk.enums.IOError e) { + long ret = bindings.CResult_UpdateNameIOErrorZ_err(e); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UpdateNameIOErrorZ ret_hu_conv = Result_UpdateNameIOErrorZ.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_UpdateNameIOErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + +} diff --git a/src/main/java/org/ldk/structs/Router.java b/src/main/java/org/ldk/structs/Router.java index c629e4a6..7d17782f 100644 --- a/src/main/java/org/ldk/structs/Router.java +++ b/src/main/java/org/ldk/structs/Router.java @@ -14,10 +14,9 @@ import javax.annotation.Nullable; public class Router extends CommonBase { final bindings.LDKRouter bindings_instance; Router(Object _dummy, long ptr) { super(ptr); bindings_instance = null; } - private Router(bindings.LDKRouter arg, bindings.LDKMessageRouter MessageRouter) { - super(bindings.LDKRouter_new(arg, MessageRouter)); + private Router(bindings.LDKRouter arg) { + super(bindings.LDKRouter_new(arg)); this.ptrs_to.add(arg); - this.ptrs_to.add(MessageRouter); this.bindings_instance = arg; } @Override @SuppressWarnings("deprecation") @@ -67,7 +66,7 @@ public class Router extends CommonBase { 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) { + public static Router new_impl(RouterInterface arg) { final LDKRouterHolder impl_holder = new LDKRouterHolder(); impl_holder.held = new Router(new bindings.LDKRouter() { @Override public long find_route(byte[] payer, long route_params, long[] first_hops, long inflight_htlcs) { @@ -124,19 +123,9 @@ public class Router extends CommonBase { long result = ret.clone_ptr(); return result; } - }, MessageRouter.new_impl(MessageRouter_impl).bindings_instance); + }); return impl_holder.held; } - - /** - * Gets the underlying MessageRouter. - */ - public MessageRouter get_message_router() { - MessageRouter res = new MessageRouter(null, bindings.LDKRouter_get_MessageRouter(this.ptr)); - res.ptrs_to.add(this); - return res; - } - /** * Finds a [`Route`] for a payment between the given `payer` and a payee. * diff --git a/src/main/java/org/ldk/structs/RoutingMessageHandler.java b/src/main/java/org/ldk/structs/RoutingMessageHandler.java index 8d21fcbf..896a3c70 100644 --- a/src/main/java/org/ldk/structs/RoutingMessageHandler.java +++ b/src/main/java/org/ldk/structs/RoutingMessageHandler.java @@ -47,18 +47,30 @@ public class RoutingMessageHandler extends CommonBase { /** * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on, * `false` or returning an `Err` otherwise. + * + * If `their_node_id` is `None`, the message was generated by our own local node. + * + * Note that their_node_id (or a relevant inner pointer) may be NULL or all-0s to represent None */ - Result_boolLightningErrorZ handle_node_announcement(NodeAnnouncement msg); + Result_boolLightningErrorZ handle_node_announcement(byte[] their_node_id, NodeAnnouncement msg); /** * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false` * or returning an `Err` otherwise. + * + * If `their_node_id` is `None`, the message was generated by our own local node. + * + * Note that their_node_id (or a relevant inner pointer) may be NULL or all-0s to represent None */ - Result_boolLightningErrorZ handle_channel_announcement(ChannelAnnouncement msg); + Result_boolLightningErrorZ handle_channel_announcement(byte[] their_node_id, ChannelAnnouncement msg); /** * Handle an incoming `channel_update` message, returning true if it should be forwarded on, * `false` or returning an `Err` otherwise. + * + * If `their_node_id` is `None`, the message was generated by our own local node. + * + * Note that their_node_id (or a relevant inner pointer) may be NULL or all-0s to represent None */ - Result_boolLightningErrorZ handle_channel_update(ChannelUpdate msg); + Result_boolLightningErrorZ handle_channel_update(byte[] their_node_id, ChannelUpdate msg); /** * Gets channel announcements and updates required to dump our routing table to a remote node, * starting at the `short_channel_id` indicated by `starting_point` and including announcements @@ -134,23 +146,23 @@ public class RoutingMessageHandler extends CommonBase { public static RoutingMessageHandler new_impl(RoutingMessageHandlerInterface arg, MessageSendEventsProvider.MessageSendEventsProviderInterface MessageSendEventsProvider_impl) { final LDKRoutingMessageHandlerHolder impl_holder = new LDKRoutingMessageHandlerHolder(); impl_holder.held = new RoutingMessageHandler(new bindings.LDKRoutingMessageHandler() { - @Override public long handle_node_announcement(long msg) { + @Override public long handle_node_announcement(byte[] their_node_id, long msg) { org.ldk.structs.NodeAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.NodeAnnouncement(null, msg); } - Result_boolLightningErrorZ ret = arg.handle_node_announcement(msg_hu_conv); + Result_boolLightningErrorZ ret = arg.handle_node_announcement(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); long result = ret.clone_ptr(); return result; } - @Override public long handle_channel_announcement(long msg) { + @Override public long handle_channel_announcement(byte[] their_node_id, long msg) { org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); } - Result_boolLightningErrorZ ret = arg.handle_channel_announcement(msg_hu_conv); + Result_boolLightningErrorZ ret = arg.handle_channel_announcement(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); long result = ret.clone_ptr(); return result; } - @Override public long handle_channel_update(long msg) { + @Override public long handle_channel_update(byte[] their_node_id, long msg) { org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); } - Result_boolLightningErrorZ ret = arg.handle_channel_update(msg_hu_conv); + Result_boolLightningErrorZ ret = arg.handle_channel_update(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); long result = ret.clone_ptr(); return result; @@ -241,10 +253,15 @@ public class RoutingMessageHandler extends CommonBase { /** * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on, * `false` or returning an `Err` otherwise. + * + * If `their_node_id` is `None`, the message was generated by our own local node. + * + * Note that their_node_id (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Result_boolLightningErrorZ handle_node_announcement(org.ldk.structs.NodeAnnouncement msg) { - long ret = bindings.RoutingMessageHandler_handle_node_announcement(this.ptr, msg.ptr); + public Result_boolLightningErrorZ handle_node_announcement(@Nullable byte[] their_node_id, org.ldk.structs.NodeAnnouncement msg) { + long ret = bindings.RoutingMessageHandler_handle_node_announcement(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg.ptr); Reference.reachabilityFence(this); + Reference.reachabilityFence(their_node_id); Reference.reachabilityFence(msg); if (ret >= 0 && ret <= 4096) { return null; } Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); @@ -255,10 +272,15 @@ public class RoutingMessageHandler extends CommonBase { /** * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false` * or returning an `Err` otherwise. + * + * If `their_node_id` is `None`, the message was generated by our own local node. + * + * Note that their_node_id (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Result_boolLightningErrorZ handle_channel_announcement(org.ldk.structs.ChannelAnnouncement msg) { - long ret = bindings.RoutingMessageHandler_handle_channel_announcement(this.ptr, msg.ptr); + public Result_boolLightningErrorZ handle_channel_announcement(@Nullable byte[] their_node_id, org.ldk.structs.ChannelAnnouncement msg) { + long ret = bindings.RoutingMessageHandler_handle_channel_announcement(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg.ptr); Reference.reachabilityFence(this); + Reference.reachabilityFence(their_node_id); Reference.reachabilityFence(msg); if (ret >= 0 && ret <= 4096) { return null; } Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); @@ -269,10 +291,15 @@ public class RoutingMessageHandler extends CommonBase { /** * Handle an incoming `channel_update` message, returning true if it should be forwarded on, * `false` or returning an `Err` otherwise. + * + * If `their_node_id` is `None`, the message was generated by our own local node. + * + * Note that their_node_id (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Result_boolLightningErrorZ handle_channel_update(org.ldk.structs.ChannelUpdate msg) { - long ret = bindings.RoutingMessageHandler_handle_channel_update(this.ptr, msg.ptr); + public Result_boolLightningErrorZ handle_channel_update(@Nullable byte[] their_node_id, org.ldk.structs.ChannelUpdate msg) { + long ret = bindings.RoutingMessageHandler_handle_channel_update(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg.ptr); Reference.reachabilityFence(this); + Reference.reachabilityFence(their_node_id); Reference.reachabilityFence(msg); if (ret >= 0 && ret <= 4096) { return null; } Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/ThreeTuple_StrStrStrZ.java b/src/main/java/org/ldk/structs/ThreeTuple_StrStrStrZ.java new file mode 100644 index 00000000..cf182944 --- /dev/null +++ b/src/main/java/org/ldk/structs/ThreeTuple_StrStrStrZ.java @@ -0,0 +1,83 @@ +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_StrStrStrZ extends CommonBase { + ThreeTuple_StrStrStrZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C3Tuple_StrStrStrZ_free(ptr); } + } + + /** + * + */ + public String get_a() { + String ret = bindings.C3Tuple_StrStrStrZ_get_a(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * + */ + public String get_b() { + String ret = bindings.C3Tuple_StrStrStrZ_get_b(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * + */ + public String get_c() { + String ret = bindings.C3Tuple_StrStrStrZ_get_c(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.C3Tuple_StrStrStrZ_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_StrStrStrZ clone() { + long ret = bindings.C3Tuple_StrStrStrZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + ThreeTuple_StrStrStrZ ret_hu_conv = new ThreeTuple_StrStrStrZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C3Tuple_StrStrStrZ from the contained elements. + */ + public static ThreeTuple_StrStrStrZ of(java.lang.String a, java.lang.String b, java.lang.String c) { + long ret = bindings.C3Tuple_StrStrStrZ_new(a, b, c); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + Reference.reachabilityFence(c); + if (ret >= 0 && ret <= 4096) { return null; } + ThreeTuple_StrStrStrZ ret_hu_conv = new ThreeTuple_StrStrStrZ(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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ.java b/src/main/java/org/ldk/structs/TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ.java new file mode 100644 index 00000000..b207350b --- /dev/null +++ b/src/main/java/org/ldk/structs/TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ.java @@ -0,0 +1,84 @@ +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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ extends CommonBase { + TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_free(ptr); } + } + + /** + * + */ + public TwoTuple_HumanReadableNameThirtyTwoBytesZ[] get_a() { + long[] ret = bindings.C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_get_a(this.ptr); + Reference.reachabilityFence(this); + int ret_conv_43_len = ret.length; + TwoTuple_HumanReadableNameThirtyTwoBytesZ[] ret_conv_43_arr = new TwoTuple_HumanReadableNameThirtyTwoBytesZ[ret_conv_43_len]; + for (int r = 0; r < ret_conv_43_len; r++) { + long ret_conv_43 = ret[r]; + TwoTuple_HumanReadableNameThirtyTwoBytesZ ret_conv_43_hu_conv = new TwoTuple_HumanReadableNameThirtyTwoBytesZ(null, ret_conv_43); + if (ret_conv_43_hu_conv != null) { ret_conv_43_hu_conv.ptrs_to.add(this); }; + ret_conv_43_arr[r] = ret_conv_43_hu_conv; + } + return ret_conv_43_arr; + } + + /** + * + */ + public Offer get_b() { + long ret = bindings.C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_get_b(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Offer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Offer(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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ clone() { + long ret = bindings.C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ ret_hu_conv = new TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ from the contained elements. + */ + public static TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ of(TwoTuple_HumanReadableNameThirtyTwoBytesZ[] a, org.ldk.structs.Offer b) { + long ret = bindings.C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_new(a != null ? Arrays.stream(a).mapToLong(a_conv_43 -> a_conv_43.ptr).toArray() : null, b.ptr); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ ret_hu_conv = new TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ(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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ.java b/src/main/java/org/ldk/structs/TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ.java new file mode 100644 index 00000000..02c33217 --- /dev/null +++ b/src/main/java/org/ldk/structs/TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ.java @@ -0,0 +1,81 @@ +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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ extends CommonBase { + TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_free(ptr); } + } + + /** + * + */ + public TwoTuple_HumanReadableNameThirtyTwoBytesZ[] get_a() { + long[] ret = bindings.C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_get_a(this.ptr); + Reference.reachabilityFence(this); + int ret_conv_43_len = ret.length; + TwoTuple_HumanReadableNameThirtyTwoBytesZ[] ret_conv_43_arr = new TwoTuple_HumanReadableNameThirtyTwoBytesZ[ret_conv_43_len]; + for (int r = 0; r < ret_conv_43_len; r++) { + long ret_conv_43 = ret[r]; + TwoTuple_HumanReadableNameThirtyTwoBytesZ ret_conv_43_hu_conv = new TwoTuple_HumanReadableNameThirtyTwoBytesZ(null, ret_conv_43); + if (ret_conv_43_hu_conv != null) { ret_conv_43_hu_conv.ptrs_to.add(this); }; + ret_conv_43_arr[r] = ret_conv_43_hu_conv; + } + return ret_conv_43_arr; + } + + /** + * + */ + public String get_b() { + String ret = bindings.C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_get_b(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ clone() { + long ret = bindings.C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ ret_hu_conv = new TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ from the contained elements. + */ + public static TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ of(TwoTuple_HumanReadableNameThirtyTwoBytesZ[] a, java.lang.String b) { + long ret = bindings.C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_new(a != null ? Arrays.stream(a).mapToLong(a_conv_43 -> a_conv_43.ptr).toArray() : null, b); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ ret_hu_conv = new TwoTuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ(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_DNSResolverMessageMessageSendInstructionsZ.java b/src/main/java/org/ldk/structs/TwoTuple_DNSResolverMessageMessageSendInstructionsZ.java new file mode 100644 index 00000000..1b0b2707 --- /dev/null +++ b/src/main/java/org/ldk/structs/TwoTuple_DNSResolverMessageMessageSendInstructionsZ.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_DNSResolverMessageMessageSendInstructionsZ extends CommonBase { + TwoTuple_DNSResolverMessageMessageSendInstructionsZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C2Tuple_DNSResolverMessageMessageSendInstructionsZ_free(ptr); } + } + + /** + * + */ + public DNSResolverMessage get_a() { + long ret = bindings.C2Tuple_DNSResolverMessageMessageSendInstructionsZ_get_a(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.DNSResolverMessage ret_hu_conv = org.ldk.structs.DNSResolverMessage.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_DNSResolverMessageMessageSendInstructionsZ_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_DNSResolverMessageMessageSendInstructionsZ_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_DNSResolverMessageMessageSendInstructionsZ clone() { + long ret = bindings.C2Tuple_DNSResolverMessageMessageSendInstructionsZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_DNSResolverMessageMessageSendInstructionsZ ret_hu_conv = new TwoTuple_DNSResolverMessageMessageSendInstructionsZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_DNSResolverMessageMessageSendInstructionsZ from the contained elements. + */ + public static TwoTuple_DNSResolverMessageMessageSendInstructionsZ of(org.ldk.structs.DNSResolverMessage a, org.ldk.structs.MessageSendInstructions b) { + long ret = bindings.C2Tuple_DNSResolverMessageMessageSendInstructionsZ_new(a.ptr, b.ptr); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_DNSResolverMessageMessageSendInstructionsZ ret_hu_conv = new TwoTuple_DNSResolverMessageMessageSendInstructionsZ(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_DNSResolverMessageResponseInstructionZ.java b/src/main/java/org/ldk/structs/TwoTuple_DNSResolverMessageResponseInstructionZ.java new file mode 100644 index 00000000..f46540f0 --- /dev/null +++ b/src/main/java/org/ldk/structs/TwoTuple_DNSResolverMessageResponseInstructionZ.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_DNSResolverMessageResponseInstructionZ extends CommonBase { + TwoTuple_DNSResolverMessageResponseInstructionZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C2Tuple_DNSResolverMessageResponseInstructionZ_free(ptr); } + } + + /** + * + */ + public DNSResolverMessage get_a() { + long ret = bindings.C2Tuple_DNSResolverMessageResponseInstructionZ_get_a(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.DNSResolverMessage ret_hu_conv = org.ldk.structs.DNSResolverMessage.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_DNSResolverMessageResponseInstructionZ_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_DNSResolverMessageResponseInstructionZ_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_DNSResolverMessageResponseInstructionZ clone() { + long ret = bindings.C2Tuple_DNSResolverMessageResponseInstructionZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_DNSResolverMessageResponseInstructionZ ret_hu_conv = new TwoTuple_DNSResolverMessageResponseInstructionZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_DNSResolverMessageResponseInstructionZ from the contained elements. + */ + public static TwoTuple_DNSResolverMessageResponseInstructionZ of(org.ldk.structs.DNSResolverMessage a, org.ldk.structs.ResponseInstruction b) { + long ret = bindings.C2Tuple_DNSResolverMessageResponseInstructionZ_new(a.ptr, b.ptr); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_DNSResolverMessageResponseInstructionZ ret_hu_conv = new TwoTuple_DNSResolverMessageResponseInstructionZ(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_DNSSECQueryDNSResolverContextZ.java b/src/main/java/org/ldk/structs/TwoTuple_DNSSECQueryDNSResolverContextZ.java new file mode 100644 index 00000000..1886e5a1 --- /dev/null +++ b/src/main/java/org/ldk/structs/TwoTuple_DNSSECQueryDNSResolverContextZ.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_DNSSECQueryDNSResolverContextZ extends CommonBase { + TwoTuple_DNSSECQueryDNSResolverContextZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C2Tuple_DNSSECQueryDNSResolverContextZ_free(ptr); } + } + + /** + * + */ + public DNSSECQuery get_a() { + long ret = bindings.C2Tuple_DNSSECQueryDNSResolverContextZ_get_a(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.DNSSECQuery ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DNSSECQuery(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * + */ + public DNSResolverContext get_b() { + long ret = bindings.C2Tuple_DNSSECQueryDNSResolverContextZ_get_b(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.DNSResolverContext ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DNSResolverContext(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_DNSSECQueryDNSResolverContextZ_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_DNSSECQueryDNSResolverContextZ clone() { + long ret = bindings.C2Tuple_DNSSECQueryDNSResolverContextZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_DNSSECQueryDNSResolverContextZ ret_hu_conv = new TwoTuple_DNSSECQueryDNSResolverContextZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_DNSSECQueryDNSResolverContextZ from the contained elements. + */ + public static TwoTuple_DNSSECQueryDNSResolverContextZ of(org.ldk.structs.DNSSECQuery a, org.ldk.structs.DNSResolverContext b) { + long ret = bindings.C2Tuple_DNSSECQueryDNSResolverContextZ_new(a.ptr, b.ptr); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_DNSSECQueryDNSResolverContextZ ret_hu_conv = new TwoTuple_DNSSECQueryDNSResolverContextZ(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_HumanReadableNameThirtyTwoBytesZ.java b/src/main/java/org/ldk/structs/TwoTuple_HumanReadableNameThirtyTwoBytesZ.java new file mode 100644 index 00000000..19fd1dab --- /dev/null +++ b/src/main/java/org/ldk/structs/TwoTuple_HumanReadableNameThirtyTwoBytesZ.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_HumanReadableNameThirtyTwoBytesZ extends CommonBase { + TwoTuple_HumanReadableNameThirtyTwoBytesZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C2Tuple_HumanReadableNameThirtyTwoBytesZ_free(ptr); } + } + + /** + * + */ + public HumanReadableName get_a() { + long ret = bindings.C2Tuple_HumanReadableNameThirtyTwoBytesZ_get_a(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.HumanReadableName ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HumanReadableName(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * + */ + public byte[] get_b() { + byte[] ret = bindings.C2Tuple_HumanReadableNameThirtyTwoBytesZ_get_b(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.C2Tuple_HumanReadableNameThirtyTwoBytesZ_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_HumanReadableNameThirtyTwoBytesZ clone() { + long ret = bindings.C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_HumanReadableNameThirtyTwoBytesZ ret_hu_conv = new TwoTuple_HumanReadableNameThirtyTwoBytesZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_HumanReadableNameThirtyTwoBytesZ from the contained elements. + */ + public static TwoTuple_HumanReadableNameThirtyTwoBytesZ of(org.ldk.structs.HumanReadableName a, byte[] b) { + long ret = bindings.C2Tuple_HumanReadableNameThirtyTwoBytesZ_new(a.ptr, InternalUtils.check_arr_len(b, 32)); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_HumanReadableNameThirtyTwoBytesZ ret_hu_conv = new TwoTuple_HumanReadableNameThirtyTwoBytesZ(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_PublicKeyChannelIdZ.java b/src/main/java/org/ldk/structs/TwoTuple_PublicKeyChannelIdZ.java new file mode 100644 index 00000000..af4e6035 --- /dev/null +++ b/src/main/java/org/ldk/structs/TwoTuple_PublicKeyChannelIdZ.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_PublicKeyChannelIdZ extends CommonBase { + TwoTuple_PublicKeyChannelIdZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C2Tuple_PublicKeyChannelIdZ_free(ptr); } + } + + /** + * + */ + public byte[] get_a() { + byte[] ret = bindings.C2Tuple_PublicKeyChannelIdZ_get_a(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * + */ + public ChannelId get_b() { + long ret = bindings.C2Tuple_PublicKeyChannelIdZ_get_b(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; + } + + long clone_ptr() { + long ret = bindings.C2Tuple_PublicKeyChannelIdZ_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_PublicKeyChannelIdZ clone() { + long ret = bindings.C2Tuple_PublicKeyChannelIdZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_PublicKeyChannelIdZ ret_hu_conv = new TwoTuple_PublicKeyChannelIdZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_PublicKeyChannelIdZ from the contained elements. + */ + public static TwoTuple_PublicKeyChannelIdZ of(byte[] a, org.ldk.structs.ChannelId b) { + long ret = bindings.C2Tuple_PublicKeyChannelIdZ_new(InternalUtils.check_arr_len(a, 33), b.ptr); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_PublicKeyChannelIdZ ret_hu_conv = new TwoTuple_PublicKeyChannelIdZ(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 72d3c21d..d49be263 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelManagerZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelManagerZ.java @@ -44,13 +44,14 @@ public class TwoTuple_ThirtyTwoBytesChannelManagerZ extends CommonBase { /** * Creates a new C2Tuple_ThirtyTwoBytesChannelManagerZ from the contained elements. */ - public static TwoTuple_ThirtyTwoBytesChannelManagerZ of(byte[] a, FeeEstimator b_fee_est, Watch b_chain_monitor, BroadcasterInterface b_tx_broadcaster, Router b_router, Logger b_logger, EntropySource b_entropy_source, NodeSigner b_node_signer, SignerProvider b_signer_provider, UserConfig b_config, ChainParameters b_params, int b_current_timestamp) { - long ret = bindings.C2Tuple_ThirtyTwoBytesChannelManagerZ_new(InternalUtils.check_arr_len(a, 32), bindings.ChannelManager_new(b_fee_est.ptr, b_chain_monitor.ptr, b_tx_broadcaster.ptr, b_router.ptr, b_logger.ptr, b_entropy_source.ptr, b_node_signer.ptr, b_signer_provider.ptr, b_config.ptr, b_params.ptr, b_current_timestamp)); + public static TwoTuple_ThirtyTwoBytesChannelManagerZ of(byte[] a, FeeEstimator b_fee_est, Watch b_chain_monitor, BroadcasterInterface b_tx_broadcaster, Router b_router, MessageRouter b_message_router, Logger b_logger, EntropySource b_entropy_source, NodeSigner b_node_signer, SignerProvider b_signer_provider, UserConfig b_config, ChainParameters b_params, int b_current_timestamp) { + long ret = bindings.C2Tuple_ThirtyTwoBytesChannelManagerZ_new(InternalUtils.check_arr_len(a, 32), bindings.ChannelManager_new(b_fee_est.ptr, b_chain_monitor.ptr, b_tx_broadcaster.ptr, b_router.ptr, b_message_router.ptr, b_logger.ptr, b_entropy_source.ptr, b_node_signer.ptr, b_signer_provider.ptr, b_config.ptr, b_params.ptr, b_current_timestamp)); Reference.reachabilityFence(a); Reference.reachabilityFence(b_fee_est); Reference.reachabilityFence(b_chain_monitor); Reference.reachabilityFence(b_tx_broadcaster); Reference.reachabilityFence(b_router); + Reference.reachabilityFence(b_message_router); Reference.reachabilityFence(b_logger); Reference.reachabilityFence(b_entropy_source); Reference.reachabilityFence(b_node_signer); @@ -65,6 +66,7 @@ public class TwoTuple_ThirtyTwoBytesChannelManagerZ extends CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_chain_monitor); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_tx_broadcaster); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_router); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_message_router); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_logger); }; 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); }; diff --git a/src/main/java/org/ldk/structs/TwoTuple_boolboolZ.java b/src/main/java/org/ldk/structs/TwoTuple_boolboolZ.java new file mode 100644 index 00000000..316dfdf2 --- /dev/null +++ b/src/main/java/org/ldk/structs/TwoTuple_boolboolZ.java @@ -0,0 +1,73 @@ +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_boolboolZ extends CommonBase { + TwoTuple_boolboolZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C2Tuple_boolboolZ_free(ptr); } + } + + /** + * + */ + public boolean get_a() { + boolean ret = bindings.C2Tuple_boolboolZ_get_a(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * + */ + public boolean get_b() { + boolean ret = bindings.C2Tuple_boolboolZ_get_b(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.C2Tuple_boolboolZ_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_boolboolZ clone() { + long ret = bindings.C2Tuple_boolboolZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_boolboolZ ret_hu_conv = new TwoTuple_boolboolZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_boolboolZ from the contained elements. + */ + public static TwoTuple_boolboolZ of(boolean a, boolean b) { + long ret = bindings.C2Tuple_boolboolZ_new(a, b); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_boolboolZ ret_hu_conv = new TwoTuple_boolboolZ(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/TxAbort.java b/src/main/java/org/ldk/structs/TxAbort.java index ef1c1b8c..1870af37 100644 --- a/src/main/java/org/ldk/structs/TxAbort.java +++ b/src/main/java/org/ldk/structs/TxAbort.java @@ -9,7 +9,9 @@ import javax.annotation.Nullable; /** - * A tx_abort message which signals the cancellation of an in-progress transaction negotiation. + * A [`tx_abort`] message which signals the cancellation of an in-progress transaction negotiation. + * + * [`tx_abort`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-tx_abort-message */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class TxAbort extends CommonBase { diff --git a/src/main/java/org/ldk/structs/TxAckRbf.java b/src/main/java/org/ldk/structs/TxAckRbf.java index 844840ab..7f0cc804 100644 --- a/src/main/java/org/ldk/structs/TxAckRbf.java +++ b/src/main/java/org/ldk/structs/TxAckRbf.java @@ -9,8 +9,10 @@ import javax.annotation.Nullable; /** - * A tx_ack_rbf message which acknowledges replacement of the transaction after it's been + * A [`tx_ack_rbf`] message which acknowledges replacement of the transaction after it's been * completed. + * + * [`tx_ack_rbf`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-tx_ack_rbf-message */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class TxAckRbf extends CommonBase { diff --git a/src/main/java/org/ldk/structs/TxAddInput.java b/src/main/java/org/ldk/structs/TxAddInput.java index c88ce847..774364c8 100644 --- a/src/main/java/org/ldk/structs/TxAddInput.java +++ b/src/main/java/org/ldk/structs/TxAddInput.java @@ -9,7 +9,9 @@ import javax.annotation.Nullable; /** - * A tx_add_input message for adding an input during interactive transaction construction + * A [`tx_add_input`] message for adding an input during interactive transaction construction + * + * [`tx_add_input`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-tx_add_input-message */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class TxAddInput extends CommonBase { diff --git a/src/main/java/org/ldk/structs/TxAddOutput.java b/src/main/java/org/ldk/structs/TxAddOutput.java index c8e2ad42..5bae2176 100644 --- a/src/main/java/org/ldk/structs/TxAddOutput.java +++ b/src/main/java/org/ldk/structs/TxAddOutput.java @@ -9,7 +9,9 @@ import javax.annotation.Nullable; /** - * A tx_add_output message for adding an output during interactive transaction construction. + * A [`tx_add_output`] message for adding an output during interactive transaction construction. + * + * [`tx_add_output`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-tx_add_output-message */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class TxAddOutput extends CommonBase { diff --git a/src/main/java/org/ldk/structs/TxComplete.java b/src/main/java/org/ldk/structs/TxComplete.java index 4fd20d7e..9cb4ed8a 100644 --- a/src/main/java/org/ldk/structs/TxComplete.java +++ b/src/main/java/org/ldk/structs/TxComplete.java @@ -9,8 +9,10 @@ import javax.annotation.Nullable; /** - * A tx_complete message signalling the conclusion of a peer's transaction contributions during + * [`A tx_complete`] message signalling the conclusion of a peer's transaction contributions during * interactive transaction construction. + * + * [`tx_complete`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-tx_complete-message */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class TxComplete extends CommonBase { diff --git a/src/main/java/org/ldk/structs/TxInitRbf.java b/src/main/java/org/ldk/structs/TxInitRbf.java index e1366cca..489d81e6 100644 --- a/src/main/java/org/ldk/structs/TxInitRbf.java +++ b/src/main/java/org/ldk/structs/TxInitRbf.java @@ -9,8 +9,10 @@ import javax.annotation.Nullable; /** - * A tx_init_rbf message which initiates a replacement of the transaction after it's been + * A [`tx_init_rbf`] message which initiates a replacement of the transaction after it's been * completed. + * + * [`tx_init_rbf`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-tx_init_rbf-message */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class TxInitRbf extends CommonBase { diff --git a/src/main/java/org/ldk/structs/TxRemoveInput.java b/src/main/java/org/ldk/structs/TxRemoveInput.java index 0c6ed906..935937e2 100644 --- a/src/main/java/org/ldk/structs/TxRemoveInput.java +++ b/src/main/java/org/ldk/structs/TxRemoveInput.java @@ -9,7 +9,9 @@ import javax.annotation.Nullable; /** - * A tx_remove_input message for removing an input during interactive transaction construction. + * A [`tx_remove_input`] message for removing an input during interactive transaction construction. + * + * [`tx_remove_input`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-tx_remove_input-and-tx_remove_output-messages */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class TxRemoveInput extends CommonBase { diff --git a/src/main/java/org/ldk/structs/TxRemoveOutput.java b/src/main/java/org/ldk/structs/TxRemoveOutput.java index 3924b1e0..ea28dc36 100644 --- a/src/main/java/org/ldk/structs/TxRemoveOutput.java +++ b/src/main/java/org/ldk/structs/TxRemoveOutput.java @@ -9,7 +9,9 @@ import javax.annotation.Nullable; /** - * A tx_remove_output message for removing an output during interactive transaction construction. + * A [`tx_remove_output`] message for removing an output during interactive transaction construction. + * + * [`tx_remove_output`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-tx_remove_input-and-tx_remove_output-messages */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class TxRemoveOutput extends CommonBase { diff --git a/src/main/java/org/ldk/structs/TxSignatures.java b/src/main/java/org/ldk/structs/TxSignatures.java index 91881c0d..feeaed52 100644 --- a/src/main/java/org/ldk/structs/TxSignatures.java +++ b/src/main/java/org/ldk/structs/TxSignatures.java @@ -9,8 +9,10 @@ import javax.annotation.Nullable; /** - * A tx_signatures message containing the sender's signatures for a transaction constructed with + * A [`tx_signatures`] message containing the sender's signatures for a transaction constructed with * interactive transaction construction. + * + * [`tx_signatures`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-tx_signatures-message */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class TxSignatures extends CommonBase { diff --git a/src/main/java/org/ldk/structs/UnauthenticatedReceiveTlvs.java b/src/main/java/org/ldk/structs/UnauthenticatedReceiveTlvs.java new file mode 100644 index 00000000..609b488e --- /dev/null +++ b/src/main/java/org/ldk/structs/UnauthenticatedReceiveTlvs.java @@ -0,0 +1,154 @@ +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 unauthenticated [`ReceiveTlvs`]. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class UnauthenticatedReceiveTlvs extends CommonBase { + UnauthenticatedReceiveTlvs(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.UnauthenticatedReceiveTlvs_free(ptr); } + } + + /** + * Constructs a new Verification which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned Verification must be freed before this_arg is + */ + public Verification as_Verification() { + long ret = bindings.UnauthenticatedReceiveTlvs_as_Verification(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Verification ret_hu_conv = new Verification(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together. + */ + public byte[] get_payment_secret() { + byte[] ret = bindings.UnauthenticatedReceiveTlvs_get_payment_secret(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together. + */ + public void set_payment_secret(byte[] val) { + bindings.UnauthenticatedReceiveTlvs_set_payment_secret(this.ptr, InternalUtils.check_arr_len(val, 32)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Constraints for the receiver of this payment. + */ + public PaymentConstraints get_payment_constraints() { + long ret = bindings.UnauthenticatedReceiveTlvs_get_payment_constraints(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PaymentConstraints ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentConstraints(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Constraints for the receiver of this payment. + */ + public void set_payment_constraints(org.ldk.structs.PaymentConstraints val) { + bindings.UnauthenticatedReceiveTlvs_set_payment_constraints(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Context for the receiver of this payment. + */ + public PaymentContext get_payment_context() { + long ret = bindings.UnauthenticatedReceiveTlvs_get_payment_context(this.ptr); + Reference.reachabilityFence(this); + 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(this); }; + return ret_hu_conv; + } + + /** + * Context for the receiver of this payment. + */ + public void set_payment_context(org.ldk.structs.PaymentContext val) { + bindings.UnauthenticatedReceiveTlvs_set_payment_context(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Constructs a new UnauthenticatedReceiveTlvs given each field + */ + public static UnauthenticatedReceiveTlvs of(byte[] payment_secret_arg, org.ldk.structs.PaymentConstraints payment_constraints_arg, org.ldk.structs.PaymentContext payment_context_arg) { + long ret = bindings.UnauthenticatedReceiveTlvs_new(InternalUtils.check_arr_len(payment_secret_arg, 32), payment_constraints_arg.ptr, payment_context_arg.ptr); + Reference.reachabilityFence(payment_secret_arg); + Reference.reachabilityFence(payment_constraints_arg); + Reference.reachabilityFence(payment_context_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UnauthenticatedReceiveTlvs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnauthenticatedReceiveTlvs(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.UnauthenticatedReceiveTlvs_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the UnauthenticatedReceiveTlvs + */ + public UnauthenticatedReceiveTlvs clone() { + long ret = bindings.UnauthenticatedReceiveTlvs_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UnauthenticatedReceiveTlvs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnauthenticatedReceiveTlvs(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates an authenticated [`ReceiveTlvs`], which includes an HMAC and the provide [`Nonce`] + * that can be use later to verify it authenticity. + */ + public ReceiveTlvs authenticate(org.ldk.structs.Nonce nonce, org.ldk.structs.ExpandedKey expanded_key) { + long ret = bindings.UnauthenticatedReceiveTlvs_authenticate(this.ptr, nonce.ptr, expanded_key.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(nonce); + Reference.reachabilityFence(expanded_key); + 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(this); }; + if (this != null) { this.ptrs_to.add(expanded_key); }; + ; + return ret_hu_conv; + } + + /** + * Serialize the UnauthenticatedReceiveTlvs object into a byte array which can be read by UnauthenticatedReceiveTlvs_read + */ + public byte[] write() { + byte[] ret = bindings.UnauthenticatedReceiveTlvs_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + +} diff --git a/src/main/java/org/ldk/structs/UnknownPaymentContext.java b/src/main/java/org/ldk/structs/UnknownPaymentContext.java deleted file mode 100644 index e1052927..00000000 --- a/src/main/java/org/ldk/structs/UnknownPaymentContext.java +++ /dev/null @@ -1,78 +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 unknown payment context. - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class UnknownPaymentContext extends CommonBase { - UnknownPaymentContext(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.UnknownPaymentContext_free(ptr); } - } - - long clone_ptr() { - long ret = bindings.UnknownPaymentContext_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a copy of the UnknownPaymentContext - */ - public UnknownPaymentContext clone() { - long ret = bindings.UnknownPaymentContext_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.UnknownPaymentContext ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnknownPaymentContext(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - - /** - * Checks if two UnknownPaymentContexts 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.UnknownPaymentContext b) { - boolean ret = bindings.UnknownPaymentContext_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 UnknownPaymentContext)) return false; - return this.eq((UnknownPaymentContext)o); - } - /** - * Serialize the UnknownPaymentContext object into a byte array which can be read by UnknownPaymentContext_read - */ - public byte[] write() { - byte[] ret = bindings.UnknownPaymentContext_write(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Read a UnknownPaymentContext from a byte array, created by UnknownPaymentContext_write - */ - public static Result_UnknownPaymentContextDecodeErrorZ read(byte[] ser) { - long ret = bindings.UnknownPaymentContext_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_UnknownPaymentContextDecodeErrorZ ret_hu_conv = Result_UnknownPaymentContextDecodeErrorZ.constr_from_ptr(ret); - 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 e329865b..c2f44c04 100644 --- a/src/main/java/org/ldk/structs/UnsignedBolt12Invoice.java +++ b/src/main/java/org/ldk/structs/UnsignedBolt12Invoice.java @@ -55,6 +55,28 @@ public class UnsignedBolt12Invoice extends CommonBase { return ret_hu_conv; } + /** + * Paths to the recipient originating from publicly reachable nodes, including information + * needed for routing payments across them. + * + * Blinded paths provide recipient privacy by obfuscating its node id. Note, however, that this + * privacy is lost if a public node id is used for + * [`UnsignedBolt12Invoice::signing_pubkey`]. + */ + public BlindedPaymentPath[] payment_paths() { + long[] ret = bindings.UnsignedBolt12Invoice_payment_paths(this.ptr); + Reference.reachabilityFence(this); + int ret_conv_20_len = ret.length; + BlindedPaymentPath[] ret_conv_20_arr = new BlindedPaymentPath[ret_conv_20_len]; + for (int u = 0; u < ret_conv_20_len; u++) { + long ret_conv_20 = ret[u]; + org.ldk.structs.BlindedPaymentPath ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.BlindedPaymentPath(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_20_arr; + } + /** * Duration since the Unix epoch when the invoice was created. */ @@ -66,7 +88,7 @@ public class UnsignedBolt12Invoice extends CommonBase { /** * Duration since - * [`Bolt12Invoice::created_at`] + * [`UnsignedBolt12Invoice::created_at`] * when the invoice has expired and therefore should no longer be paid. */ public long relative_expiry() { @@ -107,7 +129,19 @@ public class UnsignedBolt12Invoice extends CommonBase { } /** - * The public key corresponding to the key used to sign the invoice. + * A typically transient public key corresponding to the key used to sign the invoice. + * + * If the invoices was created in response to an [`Offer`], then this will be: + * - [`Offer::issuer_signing_pubkey`] if it's `Some`, otherwise + * - the final blinded node id from a [`BlindedMessagePath`] in [`Offer::paths`] if `None`. + * + * If the invoice was created in response to a [`Refund`], then it is a valid pubkey chosen by + * the recipient. + * + * [`Offer`]: crate::offers::offer::Offer + * [`Offer::issuer_signing_pubkey`]: crate::offers::offer::Offer::issuer_signing_pubkey + * [`Offer::paths`]: crate::offers::offer::Offer::paths + * [`Refund`]: crate::offers::refund::Refund */ public byte[] signing_pubkey() { byte[] ret = bindings.UnsignedBolt12Invoice_signing_pubkey(this.ptr); @@ -295,6 +329,23 @@ public class UnsignedBolt12Invoice extends CommonBase { return ret_hu_conv; } + /** + * The public key used by the recipient to sign invoices. + * + * From [`Offer::issuer_signing_pubkey`] and may be `None`; also `None` if the invoice was + * created in response to a [`Refund`]. + * + * [`Offer::issuer_signing_pubkey`]: crate::offers::offer::Offer::issuer_signing_pubkey + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable + public byte[] issuer_signing_pubkey() { + byte[] ret = bindings.UnsignedBolt12Invoice_issuer_signing_pubkey(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * An unpredictable series of bytes from the payer. * @@ -340,8 +391,8 @@ public class UnsignedBolt12Invoice extends CommonBase { * * [`message_paths`]: Self::message_paths */ - public byte[] payer_id() { - byte[] ret = bindings.UnsignedBolt12Invoice_payer_id(this.ptr); + public byte[] payer_signing_pubkey() { + byte[] ret = bindings.UnsignedBolt12Invoice_payer_signing_pubkey(this.ptr); Reference.reachabilityFence(this); return ret; } diff --git a/src/main/java/org/ldk/structs/UnsignedInvoiceRequest.java b/src/main/java/org/ldk/structs/UnsignedInvoiceRequest.java index b5334cf0..8961bbf2 100644 --- a/src/main/java/org/ldk/structs/UnsignedInvoiceRequest.java +++ b/src/main/java/org/ldk/structs/UnsignedInvoiceRequest.java @@ -180,22 +180,32 @@ public class UnsignedInvoiceRequest extends CommonBase { } /** - * The public key used by the recipient to sign invoices. + * The public key corresponding to the key used by the recipient to sign invoices. + * - If [`Offer::paths`] is empty, MUST be `Some` and contain the recipient's node id for + * sending an [`InvoiceRequest`]. + * - If [`Offer::paths`] is not empty, MAY be `Some` and contain a transient id. + * - If `None`, the signing pubkey will be the final blinded node id from the + * [`BlindedMessagePath`] in [`Offer::paths`] used to send the [`InvoiceRequest`]. + * + * See also [`Bolt12Invoice::signing_pubkey`]. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`Bolt12Invoice::signing_pubkey`]: crate::offers::invoice::Bolt12Invoice::signing_pubkey * * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ @Nullable - public byte[] signing_pubkey() { - byte[] ret = bindings.UnsignedInvoiceRequest_signing_pubkey(this.ptr); + public byte[] issuer_signing_pubkey() { + byte[] ret = bindings.UnsignedInvoiceRequest_issuer_signing_pubkey(this.ptr); Reference.reachabilityFence(this); return ret; } /** * An unpredictable series of bytes, typically containing information about the derivation of - * [`payer_id`]. + * [`payer_signing_pubkey`]. * - * [`payer_id`]: Self::payer_id + * [`payer_signing_pubkey`]: Self::payer_signing_pubkey */ public byte[] payer_metadata() { byte[] ret = bindings.UnsignedInvoiceRequest_payer_metadata(this.ptr); @@ -227,6 +237,19 @@ public class UnsignedInvoiceRequest extends CommonBase { return ret_hu_conv; } + /** + * Returns whether an amount was set in the request; otherwise, if [`amount_msats`] is `Some` + * then it was inferred from the [`Offer::amount`] and [`quantity`]. + * + * [`amount_msats`]: Self::amount_msats + * [`quantity`]: Self::quantity + */ + public boolean has_amount_msats() { + boolean ret = bindings.UnsignedInvoiceRequest_has_amount_msats(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Features pertaining to requesting an invoice. */ @@ -254,8 +277,8 @@ public class UnsignedInvoiceRequest extends CommonBase { /** * A possibly transient pubkey used to sign the invoice request. */ - public byte[] payer_id() { - byte[] ret = bindings.UnsignedInvoiceRequest_payer_id(this.ptr); + public byte[] payer_signing_pubkey() { + byte[] ret = bindings.UnsignedInvoiceRequest_payer_signing_pubkey(this.ptr); Reference.reachabilityFence(this); return ret; } @@ -276,6 +299,22 @@ public class UnsignedInvoiceRequest extends CommonBase { return ret_hu_conv; } + /** + * If the [`Offer`] was sourced from a BIP 353 Human Readable Name, this should be set by the + * builder to indicate the original [`HumanReadableName`] which was resolved. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable + public HumanReadableName offer_from_hrn() { + long ret = bindings.UnsignedInvoiceRequest_offer_from_hrn(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.HumanReadableName ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HumanReadableName(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + /** * Serialize the UnsignedInvoiceRequest object into a byte array which can be read by UnsignedInvoiceRequest_read */ diff --git a/src/main/java/org/ldk/structs/UpdateName.java b/src/main/java/org/ldk/structs/UpdateName.java new file mode 100644 index 00000000..81b360d9 --- /dev/null +++ b/src/main/java/org/ldk/structs/UpdateName.java @@ -0,0 +1,100 @@ +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 struct representing a name for a channel monitor update. + * + * [`UpdateName`] is primarily used within the [`MonitorUpdatingPersister`] in + * functions that store or retrieve partial updates to channel monitors. It + * provides a consistent way to generate and parse unique identifiers for + * monitor updates based on their sequence number. + * + * The name is derived from the update's sequence ID, which is a monotonically + * increasing u64 value. This format allows for easy ordering of updates and + * efficient storage and retrieval in key-value stores. + * + * # Usage + * + * While users of the Lightning Dev Kit library generally won't need to + * interact with `UpdateName` directly, it still can be useful for custom + * persistence implementations. The u64 value is the update_id that can be + * compared with [ChannelMonitor::get_latest_update_id] to check if this update + * has been applied to the channel monitor or not, which is useful for pruning + * stale channel monitor updates off persistence. + * + * # Examples + * + * ``` + * use lightning::util::persist::UpdateName; + * + * let update_id: u64 = 42; + * let update_name = UpdateName::from(update_id); + * assert_eq!(update_name.as_str(), \"42\"); + * + * Using UpdateName to generate a storage key + * let monitor_name = \"some_monitor_name\"; + * let storage_key = format!(\"channel_monitor_updates/{}/{}\", monitor_name, update_name.as_str()); + * ``` + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class UpdateName extends CommonBase { + UpdateName(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.UpdateName_free(ptr); } + } + + public long get_a() { + long ret = bindings.UpdateName_get_a(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + public void set_a(long val) { + bindings.UpdateName_set_a(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Constructs an [`UpdateName`], after verifying that an update sequence ID + * can be derived from the given `name`. + */ + public static Result_UpdateNameIOErrorZ of(java.lang.String name) { + long ret = bindings.UpdateName_new(name); + Reference.reachabilityFence(name); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UpdateNameIOErrorZ ret_hu_conv = Result_UpdateNameIOErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Convert this update name to a string slice. + * + * This method is particularly useful when you need to use the update name + * as part of a key in a key-value store or when logging. + * + * # Examples + * + * ``` + * use lightning::util::persist::UpdateName; + * + * let update_name = UpdateName::from(42); + * assert_eq!(update_name.as_str(), \"42\"); + * ``` + */ + public String as_str() { + String ret = bindings.UpdateName_as_str(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + +} diff --git a/src/main/java/org/ldk/structs/UserConfig.java b/src/main/java/org/ldk/structs/UserConfig.java index 2a1481ee..4044c060 100644 --- a/src/main/java/org/ldk/structs/UserConfig.java +++ b/src/main/java/org/ldk/structs/UserConfig.java @@ -234,42 +234,6 @@ public class UserConfig extends CommonBase { Reference.reachabilityFence(val); } - /** - * 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 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` - * - * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager - */ - public boolean get_accept_mpp_keysend() { - boolean ret = bindings.UserConfig_get_accept_mpp_keysend(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * 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 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` - * - * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager - */ - public void set_accept_mpp_keysend(boolean val) { - bindings.UserConfig_set_accept_mpp_keysend(this.ptr, val); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - /** * If this is set to `true`, the user needs to manually pay [`Bolt12Invoice`]s when received. * @@ -315,8 +279,8 @@ public class UserConfig extends CommonBase { /** * 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, 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); + 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 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, manually_handle_bolt12_invoices_arg); Reference.reachabilityFence(channel_handshake_config_arg); Reference.reachabilityFence(channel_handshake_limits_arg); Reference.reachabilityFence(channel_config_arg); @@ -324,7 +288,6 @@ public class UserConfig extends CommonBase { Reference.reachabilityFence(accept_inbound_channels_arg); 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); } diff --git a/src/main/java/org/ldk/structs/UtilMethods.java b/src/main/java/org/ldk/structs/UtilMethods.java index a55948d0..c10a069a 100644 --- a/src/main/java/org/ldk/structs/UtilMethods.java +++ b/src/main/java/org/ldk/structs/UtilMethods.java @@ -89,6 +89,27 @@ public class UtilMethods { return ret; } + /** + * Migrates all data from one store to another. + * + * This operation assumes that `target_store` is empty, i.e., any data present under copied keys + * might get overriden. User must ensure `source_store` is not modified during operation, + * otherwise no consistency guarantees can be given. + * + * Will abort and return an error if any IO operation fails. Note that in this case the + * `target_store` might get left in an intermediate state. + */ + public static Result_NoneIOErrorZ migrate_kv_store_data(org.ldk.structs.MigratableKVStore source_store, org.ldk.structs.MigratableKVStore target_store) { + long ret = bindings.migrate_kv_store_data(source_store.ptr, target_store.ptr); + Reference.reachabilityFence(source_store); + Reference.reachabilityFence(target_store); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneIOErrorZ ret_hu_conv = Result_NoneIOErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(source_store); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(target_store); }; + return ret_hu_conv; + } + /** * Read previously persisted [`ChannelMonitor`]s from the store. */ @@ -208,13 +229,12 @@ public class UtilMethods { * * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable */ - public static Result_PendingHTLCInfoInboundHTLCErrZ peel_payment_onion(org.ldk.structs.UpdateAddHTLC msg, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, int cur_height, boolean accept_mpp_keysend, boolean allow_skimmed_fees) { - long ret = bindings.peel_payment_onion(msg.ptr, node_signer.ptr, logger.ptr, cur_height, accept_mpp_keysend, allow_skimmed_fees); + public static Result_PendingHTLCInfoInboundHTLCErrZ peel_payment_onion(org.ldk.structs.UpdateAddHTLC msg, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, int cur_height, boolean allow_skimmed_fees) { + long ret = bindings.peel_payment_onion(msg.ptr, node_signer.ptr, logger.ptr, cur_height, allow_skimmed_fees); Reference.reachabilityFence(msg); Reference.reachabilityFence(node_signer); Reference.reachabilityFence(logger); Reference.reachabilityFence(cur_height); - Reference.reachabilityFence(accept_mpp_keysend); Reference.reachabilityFence(allow_skimmed_fees); if (ret >= 0 && ret <= 4096) { return null; } Result_PendingHTLCInfoInboundHTLCErrZ ret_hu_conv = Result_PendingHTLCInfoInboundHTLCErrZ.constr_from_ptr(ret); @@ -241,8 +261,8 @@ public class UtilMethods { /** * Read a C2Tuple_ThirtyTwoBytesChannelManagerZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelManagerZ_write */ - public static Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelManagerZ_read(byte[] ser, EntropySource arg_entropy_source, NodeSigner arg_node_signer, SignerProvider arg_signer_provider, FeeEstimator arg_fee_estimator, Watch arg_chain_monitor, BroadcasterInterface arg_tx_broadcaster, Router arg_router, Logger arg_logger, UserConfig arg_default_config, ChannelMonitor[] arg_channel_monitors) { - long ret = bindings.C2Tuple_ThirtyTwoBytesChannelManagerZ_read(ser, bindings.ChannelManagerReadArgs_new(arg_entropy_source.ptr, arg_node_signer.ptr, arg_signer_provider.ptr, arg_fee_estimator.ptr, arg_chain_monitor.ptr, arg_tx_broadcaster.ptr, arg_router.ptr, arg_logger.ptr, arg_default_config.ptr, arg_channel_monitors != null ? Arrays.stream(arg_channel_monitors).mapToLong(arg_channel_monitors_conv_16 -> arg_channel_monitors_conv_16.ptr).toArray() : null)); + public static Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelManagerZ_read(byte[] ser, EntropySource arg_entropy_source, NodeSigner arg_node_signer, SignerProvider arg_signer_provider, FeeEstimator arg_fee_estimator, Watch arg_chain_monitor, BroadcasterInterface arg_tx_broadcaster, Router arg_router, MessageRouter arg_message_router, Logger arg_logger, UserConfig arg_default_config, ChannelMonitor[] arg_channel_monitors) { + long ret = bindings.C2Tuple_ThirtyTwoBytesChannelManagerZ_read(ser, bindings.ChannelManagerReadArgs_new(arg_entropy_source.ptr, arg_node_signer.ptr, arg_signer_provider.ptr, arg_fee_estimator.ptr, arg_chain_monitor.ptr, arg_tx_broadcaster.ptr, arg_router.ptr, arg_message_router.ptr, arg_logger.ptr, arg_default_config.ptr, arg_channel_monitors != null ? Arrays.stream(arg_channel_monitors).mapToLong(arg_channel_monitors_conv_16 -> arg_channel_monitors_conv_16.ptr).toArray() : null)); Reference.reachabilityFence(ser); Reference.reachabilityFence(arg_entropy_source); Reference.reachabilityFence(arg_node_signer); @@ -251,6 +271,7 @@ public class UtilMethods { Reference.reachabilityFence(arg_chain_monitor); Reference.reachabilityFence(arg_tx_broadcaster); Reference.reachabilityFence(arg_router); + Reference.reachabilityFence(arg_message_router); Reference.reachabilityFence(arg_logger); Reference.reachabilityFence(arg_default_config); Reference.reachabilityFence(arg_channel_monitors); @@ -263,6 +284,7 @@ public class UtilMethods { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(arg_chain_monitor); }; 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_message_router); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(arg_logger); }; ; 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); }; }; @@ -308,9 +330,8 @@ public class UtilMethods { * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without * a `ChannelManager`. * - * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then - * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not - * regenerate it for each new inbound payment. + * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key`]. It is recommended to + * cache this value and not regenerate it for each new inbound payment. * * `current_time` is a Unix timestamp representing the current time. * @@ -318,7 +339,7 @@ public class UtilMethods { * on versions of LDK prior to 0.0.114. * * [phantom node payments]: crate::sign::PhantomKeysManager - * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material + * [`NodeSigner::get_inbound_payment_key`]: crate::sign::NodeSigner::get_inbound_payment_key */ public static Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ create(org.ldk.structs.ExpandedKey keys, org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs, org.ldk.structs.EntropySource entropy_source, long current_time, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { long ret = bindings.create(keys.ptr, min_value_msat.ptr, invoice_expiry_delta_secs, entropy_source.ptr, current_time, min_final_cltv_expiry_delta.ptr); @@ -623,8 +644,7 @@ public class UtilMethods { * [`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. + * 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_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); @@ -684,8 +704,7 @@ public class UtilMethods { * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash * [`PhantomRouteHints::channels`]: crate::ln::channelmanager::PhantomRouteHints::channels * - * 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. + * 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_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); @@ -725,12 +744,9 @@ public class UtilMethods { * * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: crate::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA */ - 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); + public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(org.ldk.structs.ChannelManager channelmanager, 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, 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(network); Reference.reachabilityFence(amt_msat); Reference.reachabilityFence(description); Reference.reachabilityFence(invoice_expiry_delta_secs); @@ -738,8 +754,6 @@ public class UtilMethods { 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); }; return ret_hu_conv; } @@ -761,12 +775,9 @@ public class UtilMethods { * * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: crate::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA */ - 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); + public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(org.ldk.structs.ChannelManager channelmanager, 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, 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); @@ -774,89 +785,57 @@ public class UtilMethods { 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); }; 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. + * See [`create_invoice_from_channelmanager`]. + * + * This version allows for providing custom [`PaymentHash`] and description hash 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 and want to set the + * description hash. */ - 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); + public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_payment_hash(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Sha256 description_hash, 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_with_description_hash_and_payment_hash(channelmanager.ptr, amt_msat.ptr, description_hash.ptr, 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_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_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; - } - - /** - * 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_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(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); 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); }; return ret_hu_conv; } /** - * See [`create_invoice_from_channelmanager_and_duration_since_epoch`] + * See [`create_invoice_from_channelmanager`]. + * * 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_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); + public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_payment_hash(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.Option_u64Z amt_msat, java.lang.String description, 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_with_payment_hash(channelmanager.ptr, amt_msat.ptr, description, 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); 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); }; return ret_hu_conv; } /** - * Builds the necessary parameters to pay or pre-flight probe the given zero-amount - * [`Bolt11Invoice`] using [`ChannelManager::send_payment`] or - * [`ChannelManager::send_preflight_probes`]. + * Builds the necessary parameters to pay or pre-flight probe the given variable-amount + * (also known as 'zero-amount') [`Bolt11Invoice`] using + * [`ChannelManager::send_payment`] or [`ChannelManager::send_preflight_probes`]. * * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the * same [`PaymentHash`] has never been paid before. @@ -867,8 +846,8 @@ public class UtilMethods { * [`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); + public static Result_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_variable_amount_invoice(org.ldk.structs.Bolt11Invoice invoice, long amount_msat) { + long ret = bindings.payment_parameters_from_variable_amount_invoice(invoice.ptr, amount_msat); Reference.reachabilityFence(invoice); Reference.reachabilityFence(amount_msat); if (ret >= 0 && ret <= 4096) { return null; } @@ -885,7 +864,7 @@ public class UtilMethods { * same [`PaymentHash`] has never been paid before. * * Will always succeed unless the invoice has no amount specified, in which case - * [`payment_parameters_from_zero_amount_invoice`] should be used. + * [`payment_parameters_from_variable_amount_invoice`] should be used. * * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment * [`ChannelManager::send_preflight_probes`]: crate::ln::channelmanager::ChannelManager::send_preflight_probes @@ -1049,6 +1028,15 @@ public class UtilMethods { return ret; } + /** + * Returns whether `tlv_type` corresponds to a TLV record for DNS Resolvers. + */ + public static boolean DNSResolverMessage_is_known_type(long tlv_type) { + boolean ret = bindings.DNSResolverMessage_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 diff --git a/src/main/java/org/ldk/structs/Verification.java b/src/main/java/org/ldk/structs/Verification.java new file mode 100644 index 00000000..21b96667 --- /dev/null +++ b/src/main/java/org/ldk/structs/Verification.java @@ -0,0 +1,103 @@ +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 trait defining behavior for creating and verifing the HMAC for authenticating a given data. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Verification extends CommonBase { + final bindings.LDKVerification bindings_instance; + Verification(Object _dummy, long ptr) { super(ptr); bindings_instance = null; } + private Verification(bindings.LDKVerification arg) { + super(bindings.LDKVerification_new(arg)); + this.ptrs_to.add(arg); + this.bindings_instance = arg; + } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.Verification_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.Verification_free(ptr); } + ptr = 0; + } + public static interface VerificationInterface { + /** + * Constructs an HMAC to include in [`OffersContext`] for the data along with the given + * [`Nonce`]. + */ + byte[] hmac_for_offer_payment(Nonce nonce, ExpandedKey expanded_key); + /** + * Authenticates the data using an HMAC and a [`Nonce`] taken from an [`OffersContext`]. + */ + Result_NoneNoneZ verify_for_offer_payment(byte[] hmac, Nonce nonce, ExpandedKey expanded_key); + } + private static class LDKVerificationHolder { Verification held; } + public static Verification new_impl(VerificationInterface arg) { + final LDKVerificationHolder impl_holder = new LDKVerificationHolder(); + impl_holder.held = new Verification(new bindings.LDKVerification() { + @Override public byte[] hmac_for_offer_payment(long nonce, long expanded_key) { + 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); }; + org.ldk.structs.ExpandedKey expanded_key_hu_conv = null; if (expanded_key < 0 || expanded_key > 4096) { expanded_key_hu_conv = new org.ldk.structs.ExpandedKey(null, expanded_key); } + byte[] ret = arg.hmac_for_offer_payment(nonce_hu_conv, expanded_key_hu_conv); + Reference.reachabilityFence(arg); + byte[] result = InternalUtils.check_arr_len(ret, 32); + return result; + } + @Override public long verify_for_offer_payment(byte[] hmac, long nonce, long expanded_key) { + 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); }; + org.ldk.structs.ExpandedKey expanded_key_hu_conv = null; if (expanded_key < 0 || expanded_key > 4096) { expanded_key_hu_conv = new org.ldk.structs.ExpandedKey(null, expanded_key); } + Result_NoneNoneZ ret = arg.verify_for_offer_payment(hmac, nonce_hu_conv, expanded_key_hu_conv); + Reference.reachabilityFence(arg); + long result = ret.clone_ptr(); + return result; + } + }); + return impl_holder.held; + } + /** + * Constructs an HMAC to include in [`OffersContext`] for the data along with the given + * [`Nonce`]. + */ + public byte[] hmac_for_offer_payment(org.ldk.structs.Nonce nonce, org.ldk.structs.ExpandedKey expanded_key) { + byte[] ret = bindings.Verification_hmac_for_offer_payment(this.ptr, nonce.ptr, expanded_key.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(nonce); + Reference.reachabilityFence(expanded_key); + if (this != null) { this.ptrs_to.add(expanded_key); }; + return ret; + } + + /** + * Authenticates the data using an HMAC and a [`Nonce`] taken from an [`OffersContext`]. + */ + public Result_NoneNoneZ verify_for_offer_payment(byte[] hmac, org.ldk.structs.Nonce nonce, org.ldk.structs.ExpandedKey expanded_key) { + long ret = bindings.Verification_verify_for_offer_payment(this.ptr, InternalUtils.check_arr_len(hmac, 32), nonce.ptr, expanded_key.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(hmac); + Reference.reachabilityFence(nonce); + Reference.reachabilityFence(expanded_key); + 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(expanded_key); }; + 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 1e1a12fe..86c79267 100644 --- a/src/main/java/org/ldk/structs/VerifiedInvoiceRequest.java +++ b/src/main/java/org/ldk/structs/VerifiedInvoiceRequest.java @@ -186,22 +186,32 @@ public class VerifiedInvoiceRequest extends CommonBase { } /** - * The public key used by the recipient to sign invoices. + * The public key corresponding to the key used by the recipient to sign invoices. + * - If [`Offer::paths`] is empty, MUST be `Some` and contain the recipient's node id for + * sending an [`InvoiceRequest`]. + * - If [`Offer::paths`] is not empty, MAY be `Some` and contain a transient id. + * - If `None`, the signing pubkey will be the final blinded node id from the + * [`BlindedMessagePath`] in [`Offer::paths`] used to send the [`InvoiceRequest`]. + * + * See also [`Bolt12Invoice::signing_pubkey`]. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`Bolt12Invoice::signing_pubkey`]: crate::offers::invoice::Bolt12Invoice::signing_pubkey * * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ @Nullable - public byte[] signing_pubkey() { - byte[] ret = bindings.VerifiedInvoiceRequest_signing_pubkey(this.ptr); + public byte[] issuer_signing_pubkey() { + byte[] ret = bindings.VerifiedInvoiceRequest_issuer_signing_pubkey(this.ptr); Reference.reachabilityFence(this); return ret; } /** * An unpredictable series of bytes, typically containing information about the derivation of - * [`payer_id`]. + * [`payer_signing_pubkey`]. * - * [`payer_id`]: Self::payer_id + * [`payer_signing_pubkey`]: Self::payer_signing_pubkey */ public byte[] payer_metadata() { byte[] ret = bindings.VerifiedInvoiceRequest_payer_metadata(this.ptr); @@ -233,6 +243,19 @@ public class VerifiedInvoiceRequest extends CommonBase { return ret_hu_conv; } + /** + * Returns whether an amount was set in the request; otherwise, if [`amount_msats`] is `Some` + * then it was inferred from the [`Offer::amount`] and [`quantity`]. + * + * [`amount_msats`]: Self::amount_msats + * [`quantity`]: Self::quantity + */ + public boolean has_amount_msats() { + boolean ret = bindings.VerifiedInvoiceRequest_has_amount_msats(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Features pertaining to requesting an invoice. */ @@ -260,8 +283,8 @@ public class VerifiedInvoiceRequest extends CommonBase { /** * A possibly transient pubkey used to sign the invoice request. */ - public byte[] payer_id() { - byte[] ret = bindings.VerifiedInvoiceRequest_payer_id(this.ptr); + public byte[] payer_signing_pubkey() { + byte[] ret = bindings.VerifiedInvoiceRequest_payer_signing_pubkey(this.ptr); Reference.reachabilityFence(this); return ret; } @@ -282,6 +305,22 @@ public class VerifiedInvoiceRequest extends CommonBase { return ret_hu_conv; } + /** + * If the [`Offer`] was sourced from a BIP 353 Human Readable Name, this should be set by the + * builder to indicate the original [`HumanReadableName`] which was resolved. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable + public HumanReadableName offer_from_hrn() { + long ret = bindings.VerifiedInvoiceRequest_offer_from_hrn(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.HumanReadableName ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HumanReadableName(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + /** * Creates an [`InvoiceBuilder`] for the request with the given required fields and using the * [`Duration`] since [`std::time::SystemTime::UNIX_EPOCH`] as the creation time. @@ -305,8 +344,8 @@ public class VerifiedInvoiceRequest extends CommonBase { * Creates an [`InvoiceBuilder`] for the request with the given required fields. * * Unless [`InvoiceBuilder::relative_expiry`] is set, the invoice will expire two hours after - * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. Useful for `no-std` builds - * where [`std::time::SystemTime`] is not available. + * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. + * Useful for non-`std` builds where [`std::time::SystemTime`] is not available. * * The caller is expected to remember the preimage of `payment_hash` in order to claim a payment * for the invoice. @@ -314,7 +353,7 @@ public class VerifiedInvoiceRequest extends CommonBase { * The `payment_paths` parameter is useful for maintaining the payment recipient's privacy. It * must contain one or more elements ordered from most-preferred to least-preferred, if there's * a preference. Note, however, that any privacy is lost if a public node id was used for - * [`Offer::signing_pubkey`]. + * [`Offer::issuer_signing_pubkey`]. * * Errors if the request contains unknown required features. * diff --git a/src/main/jni/bindings.c b/src/main/jni/bindings.c index 41f53956..38ebe313 100644 --- a/src/main/jni/bindings.c +++ b/src/main/jni/bindings.c @@ -427,24 +427,26 @@ static inline LDKBolt12SemanticError LDKBolt12SemanticError_from_java(JNIEnv *en case 8: return LDKBolt12SemanticError_UnknownRequiredFeatures; case 9: return LDKBolt12SemanticError_UnexpectedFeatures; case 10: return LDKBolt12SemanticError_MissingDescription; - case 11: return LDKBolt12SemanticError_MissingSigningPubkey; - case 12: return LDKBolt12SemanticError_InvalidSigningPubkey; - case 13: return LDKBolt12SemanticError_UnexpectedSigningPubkey; - case 14: return LDKBolt12SemanticError_MissingQuantity; - case 15: return LDKBolt12SemanticError_InvalidQuantity; - case 16: return LDKBolt12SemanticError_UnexpectedQuantity; - case 17: return LDKBolt12SemanticError_InvalidMetadata; - case 18: return LDKBolt12SemanticError_UnexpectedMetadata; - case 19: return LDKBolt12SemanticError_MissingPayerMetadata; - case 20: return LDKBolt12SemanticError_MissingPayerId; - case 21: return LDKBolt12SemanticError_DuplicatePaymentId; - case 22: return LDKBolt12SemanticError_MissingPaths; - case 23: return LDKBolt12SemanticError_UnexpectedPaths; - case 24: return LDKBolt12SemanticError_InvalidPayInfo; - case 25: return LDKBolt12SemanticError_MissingCreationTime; - case 26: return LDKBolt12SemanticError_MissingPaymentHash; - case 27: return LDKBolt12SemanticError_UnexpectedPaymentHash; - case 28: return LDKBolt12SemanticError_MissingSignature; + case 11: return LDKBolt12SemanticError_MissingIssuerSigningPubkey; + case 12: return LDKBolt12SemanticError_UnexpectedIssuerSigningPubkey; + case 13: return LDKBolt12SemanticError_MissingQuantity; + case 14: return LDKBolt12SemanticError_InvalidQuantity; + case 15: return LDKBolt12SemanticError_UnexpectedQuantity; + case 16: return LDKBolt12SemanticError_InvalidMetadata; + case 17: return LDKBolt12SemanticError_UnexpectedMetadata; + case 18: return LDKBolt12SemanticError_MissingPayerMetadata; + case 19: return LDKBolt12SemanticError_MissingPayerSigningPubkey; + case 20: return LDKBolt12SemanticError_DuplicatePaymentId; + case 21: return LDKBolt12SemanticError_MissingPaths; + case 22: return LDKBolt12SemanticError_UnexpectedPaths; + case 23: return LDKBolt12SemanticError_InvalidPayInfo; + case 24: return LDKBolt12SemanticError_MissingCreationTime; + case 25: return LDKBolt12SemanticError_MissingPaymentHash; + case 26: return LDKBolt12SemanticError_UnexpectedPaymentHash; + case 27: return LDKBolt12SemanticError_MissingSigningPubkey; + case 28: return LDKBolt12SemanticError_InvalidSigningPubkey; + case 29: return LDKBolt12SemanticError_MissingSignature; + case 30: return LDKBolt12SemanticError_UnexpectedHumanReadableName; } (*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 @@ -461,16 +463,15 @@ static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnsupportedCurrency = static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnknownRequiredFeatures = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedFeatures = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingDescription = NULL; -static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingSigningPubkey = NULL; -static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_InvalidSigningPubkey = NULL; -static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedSigningPubkey = NULL; +static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingIssuerSigningPubkey = NULL; +static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedIssuerSigningPubkey = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingQuantity = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_InvalidQuantity = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedQuantity = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_InvalidMetadata = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedMetadata = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerMetadata = NULL; -static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerId = NULL; +static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerSigningPubkey = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_DuplicatePaymentId = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingPaths = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedPaths = NULL; @@ -478,7 +479,10 @@ 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_MissingSigningPubkey = NULL; +static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_InvalidSigningPubkey = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingSignature = NULL; +static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedHumanReadableName = NULL; JNIEXPORT void JNICALL Java_org_ldk_enums_Bolt12SemanticError_init (JNIEnv *env, jclass clz) { Bolt12SemanticError_class = (*env)->NewGlobalRef(env, clz); CHECK(Bolt12SemanticError_class != NULL); @@ -504,12 +508,10 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_Bolt12SemanticError_init (JNIEnv *env, CHECK(Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedFeatures != NULL); Bolt12SemanticError_LDKBolt12SemanticError_MissingDescription = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingDescription", "Lorg/ldk/enums/Bolt12SemanticError;"); CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingDescription != NULL); - Bolt12SemanticError_LDKBolt12SemanticError_MissingSigningPubkey = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingSigningPubkey", "Lorg/ldk/enums/Bolt12SemanticError;"); - CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingSigningPubkey != NULL); - Bolt12SemanticError_LDKBolt12SemanticError_InvalidSigningPubkey = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_InvalidSigningPubkey", "Lorg/ldk/enums/Bolt12SemanticError;"); - CHECK(Bolt12SemanticError_LDKBolt12SemanticError_InvalidSigningPubkey != NULL); - Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedSigningPubkey = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_UnexpectedSigningPubkey", "Lorg/ldk/enums/Bolt12SemanticError;"); - CHECK(Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedSigningPubkey != NULL); + Bolt12SemanticError_LDKBolt12SemanticError_MissingIssuerSigningPubkey = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingIssuerSigningPubkey", "Lorg/ldk/enums/Bolt12SemanticError;"); + CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingIssuerSigningPubkey != NULL); + Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedIssuerSigningPubkey = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_UnexpectedIssuerSigningPubkey", "Lorg/ldk/enums/Bolt12SemanticError;"); + CHECK(Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedIssuerSigningPubkey != NULL); Bolt12SemanticError_LDKBolt12SemanticError_MissingQuantity = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingQuantity", "Lorg/ldk/enums/Bolt12SemanticError;"); CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingQuantity != NULL); Bolt12SemanticError_LDKBolt12SemanticError_InvalidQuantity = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_InvalidQuantity", "Lorg/ldk/enums/Bolt12SemanticError;"); @@ -522,8 +524,8 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_Bolt12SemanticError_init (JNIEnv *env, CHECK(Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedMetadata != NULL); Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerMetadata = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingPayerMetadata", "Lorg/ldk/enums/Bolt12SemanticError;"); CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerMetadata != NULL); - Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerId = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingPayerId", "Lorg/ldk/enums/Bolt12SemanticError;"); - CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerId != NULL); + Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerSigningPubkey = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingPayerSigningPubkey", "Lorg/ldk/enums/Bolt12SemanticError;"); + CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerSigningPubkey != NULL); Bolt12SemanticError_LDKBolt12SemanticError_DuplicatePaymentId = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_DuplicatePaymentId", "Lorg/ldk/enums/Bolt12SemanticError;"); CHECK(Bolt12SemanticError_LDKBolt12SemanticError_DuplicatePaymentId != NULL); Bolt12SemanticError_LDKBolt12SemanticError_MissingPaths = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingPaths", "Lorg/ldk/enums/Bolt12SemanticError;"); @@ -538,8 +540,14 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_Bolt12SemanticError_init (JNIEnv *env, 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_MissingSigningPubkey = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingSigningPubkey", "Lorg/ldk/enums/Bolt12SemanticError;"); + CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingSigningPubkey != NULL); + Bolt12SemanticError_LDKBolt12SemanticError_InvalidSigningPubkey = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_InvalidSigningPubkey", "Lorg/ldk/enums/Bolt12SemanticError;"); + CHECK(Bolt12SemanticError_LDKBolt12SemanticError_InvalidSigningPubkey != NULL); Bolt12SemanticError_LDKBolt12SemanticError_MissingSignature = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingSignature", "Lorg/ldk/enums/Bolt12SemanticError;"); CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingSignature != NULL); + Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedHumanReadableName = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_UnexpectedHumanReadableName", "Lorg/ldk/enums/Bolt12SemanticError;"); + CHECK(Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedHumanReadableName != NULL); } static inline jclass LDKBolt12SemanticError_to_java(JNIEnv *env, LDKBolt12SemanticError val) { switch (val) { @@ -565,12 +573,10 @@ static inline jclass LDKBolt12SemanticError_to_java(JNIEnv *env, LDKBolt12Semant return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedFeatures); case LDKBolt12SemanticError_MissingDescription: return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingDescription); - case LDKBolt12SemanticError_MissingSigningPubkey: - return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingSigningPubkey); - case LDKBolt12SemanticError_InvalidSigningPubkey: - return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_InvalidSigningPubkey); - case LDKBolt12SemanticError_UnexpectedSigningPubkey: - return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedSigningPubkey); + case LDKBolt12SemanticError_MissingIssuerSigningPubkey: + return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingIssuerSigningPubkey); + case LDKBolt12SemanticError_UnexpectedIssuerSigningPubkey: + return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedIssuerSigningPubkey); case LDKBolt12SemanticError_MissingQuantity: return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingQuantity); case LDKBolt12SemanticError_InvalidQuantity: @@ -583,8 +589,8 @@ static inline jclass LDKBolt12SemanticError_to_java(JNIEnv *env, LDKBolt12Semant return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedMetadata); case LDKBolt12SemanticError_MissingPayerMetadata: return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerMetadata); - case LDKBolt12SemanticError_MissingPayerId: - return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerId); + case LDKBolt12SemanticError_MissingPayerSigningPubkey: + return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerSigningPubkey); case LDKBolt12SemanticError_DuplicatePaymentId: return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_DuplicatePaymentId); case LDKBolt12SemanticError_MissingPaths: @@ -599,8 +605,14 @@ static inline jclass LDKBolt12SemanticError_to_java(JNIEnv *env, LDKBolt12Semant return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingPaymentHash); case LDKBolt12SemanticError_UnexpectedPaymentHash: return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedPaymentHash); + case LDKBolt12SemanticError_MissingSigningPubkey: + return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingSigningPubkey); + case LDKBolt12SemanticError_InvalidSigningPubkey: + return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_InvalidSigningPubkey); case LDKBolt12SemanticError_MissingSignature: return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingSignature); + case LDKBolt12SemanticError_UnexpectedHumanReadableName: + return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedHumanReadableName); default: abort(); } } @@ -1339,6 +1351,7 @@ static inline LDKPaymentFailureReason LDKPaymentFailureReason_from_java(JNIEnv * case 6: return LDKPaymentFailureReason_UnknownRequiredFeatures; case 7: return LDKPaymentFailureReason_InvoiceRequestExpired; case 8: return LDKPaymentFailureReason_InvoiceRequestRejected; + case 9: return LDKPaymentFailureReason_BlindedPathCreationFailed; } (*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 @@ -1353,6 +1366,7 @@ static jfieldID PaymentFailureReason_LDKPaymentFailureReason_UnexpectedError = N static jfieldID PaymentFailureReason_LDKPaymentFailureReason_UnknownRequiredFeatures = NULL; static jfieldID PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestExpired = NULL; static jfieldID PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestRejected = NULL; +static jfieldID PaymentFailureReason_LDKPaymentFailureReason_BlindedPathCreationFailed = NULL; JNIEXPORT void JNICALL Java_org_ldk_enums_PaymentFailureReason_init (JNIEnv *env, jclass clz) { PaymentFailureReason_class = (*env)->NewGlobalRef(env, clz); CHECK(PaymentFailureReason_class != NULL); @@ -1374,6 +1388,8 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_PaymentFailureReason_init (JNIEnv *env CHECK(PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestExpired != NULL); PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestRejected = (*env)->GetStaticFieldID(env, PaymentFailureReason_class, "LDKPaymentFailureReason_InvoiceRequestRejected", "Lorg/ldk/enums/PaymentFailureReason;"); CHECK(PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestRejected != NULL); + PaymentFailureReason_LDKPaymentFailureReason_BlindedPathCreationFailed = (*env)->GetStaticFieldID(env, PaymentFailureReason_class, "LDKPaymentFailureReason_BlindedPathCreationFailed", "Lorg/ldk/enums/PaymentFailureReason;"); + CHECK(PaymentFailureReason_LDKPaymentFailureReason_BlindedPathCreationFailed != NULL); } static inline jclass LDKPaymentFailureReason_to_java(JNIEnv *env, LDKPaymentFailureReason val) { switch (val) { @@ -1395,6 +1411,8 @@ static inline jclass LDKPaymentFailureReason_to_java(JNIEnv *env, LDKPaymentFail return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestExpired); case LDKPaymentFailureReason_InvoiceRequestRejected: return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestRejected); + case LDKPaymentFailureReason_BlindedPathCreationFailed: + return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_BlindedPathCreationFailed); default: abort(); } } @@ -2126,122 +2144,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RetryDecodeErrorZ_ return ret_ref; } -static jclass LDKAPIError_APIMisuseError_class = NULL; -static jmethodID LDKAPIError_APIMisuseError_meth = NULL; -static jclass LDKAPIError_FeeRateTooHigh_class = NULL; -static jmethodID LDKAPIError_FeeRateTooHigh_meth = NULL; -static jclass LDKAPIError_InvalidRoute_class = NULL; -static jmethodID LDKAPIError_InvalidRoute_meth = NULL; -static jclass LDKAPIError_ChannelUnavailable_class = NULL; -static jmethodID LDKAPIError_ChannelUnavailable_meth = NULL; -static jclass LDKAPIError_MonitorUpdateInProgress_class = NULL; -static jmethodID LDKAPIError_MonitorUpdateInProgress_meth = NULL; -static jclass LDKAPIError_IncompatibleShutdownScript_class = NULL; -static jmethodID LDKAPIError_IncompatibleShutdownScript_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv *env, jclass clz) { - LDKAPIError_APIMisuseError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$APIMisuseError")); - CHECK(LDKAPIError_APIMisuseError_class != NULL); - LDKAPIError_APIMisuseError_meth = (*env)->GetMethodID(env, LDKAPIError_APIMisuseError_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKAPIError_APIMisuseError_meth != NULL); - LDKAPIError_FeeRateTooHigh_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$FeeRateTooHigh")); - CHECK(LDKAPIError_FeeRateTooHigh_class != NULL); - LDKAPIError_FeeRateTooHigh_meth = (*env)->GetMethodID(env, LDKAPIError_FeeRateTooHigh_class, "", "(Ljava/lang/String;I)V"); - CHECK(LDKAPIError_FeeRateTooHigh_meth != NULL); - LDKAPIError_InvalidRoute_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$InvalidRoute")); - CHECK(LDKAPIError_InvalidRoute_class != NULL); - LDKAPIError_InvalidRoute_meth = (*env)->GetMethodID(env, LDKAPIError_InvalidRoute_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKAPIError_InvalidRoute_meth != NULL); - LDKAPIError_ChannelUnavailable_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$ChannelUnavailable")); - CHECK(LDKAPIError_ChannelUnavailable_class != NULL); - LDKAPIError_ChannelUnavailable_meth = (*env)->GetMethodID(env, LDKAPIError_ChannelUnavailable_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKAPIError_ChannelUnavailable_meth != NULL); - LDKAPIError_MonitorUpdateInProgress_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$MonitorUpdateInProgress")); - CHECK(LDKAPIError_MonitorUpdateInProgress_class != NULL); - LDKAPIError_MonitorUpdateInProgress_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateInProgress_class, "", "()V"); - CHECK(LDKAPIError_MonitorUpdateInProgress_meth != NULL); - LDKAPIError_IncompatibleShutdownScript_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$IncompatibleShutdownScript")); - CHECK(LDKAPIError_IncompatibleShutdownScript_class != NULL); - LDKAPIError_IncompatibleShutdownScript_meth = (*env)->GetMethodID(env, LDKAPIError_IncompatibleShutdownScript_class, "", "(J)V"); - CHECK(LDKAPIError_IncompatibleShutdownScript_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr); - switch(obj->tag) { - case LDKAPIError_APIMisuseError: { - LDKStr err_str = obj->api_misuse_error.err; - jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); - return (*env)->NewObject(env, LDKAPIError_APIMisuseError_class, LDKAPIError_APIMisuseError_meth, err_conv); - } - case LDKAPIError_FeeRateTooHigh: { - LDKStr err_str = obj->fee_rate_too_high.err; - jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); - int32_t feerate_conv = obj->fee_rate_too_high.feerate; - return (*env)->NewObject(env, LDKAPIError_FeeRateTooHigh_class, LDKAPIError_FeeRateTooHigh_meth, err_conv, feerate_conv); - } - case LDKAPIError_InvalidRoute: { - LDKStr err_str = obj->invalid_route.err; - jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); - return (*env)->NewObject(env, LDKAPIError_InvalidRoute_class, LDKAPIError_InvalidRoute_meth, err_conv); - } - case LDKAPIError_ChannelUnavailable: { - LDKStr err_str = obj->channel_unavailable.err; - jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); - return (*env)->NewObject(env, LDKAPIError_ChannelUnavailable_class, LDKAPIError_ChannelUnavailable_meth, err_conv); - } - case LDKAPIError_MonitorUpdateInProgress: { - return (*env)->NewObject(env, LDKAPIError_MonitorUpdateInProgress_class, LDKAPIError_MonitorUpdateInProgress_meth); - } - case LDKAPIError_IncompatibleShutdownScript: { - LDKShutdownScript script_var = obj->incompatible_shutdown_script.script; - int64_t script_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var); - script_ref = tag_ptr(script_var.inner, false); - return (*env)->NewObject(env, LDKAPIError_IncompatibleShutdownScript_class, LDKAPIError_IncompatibleShutdownScript_meth, script_ref); - } - default: abort(); - } -} -static inline void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner); - CResult_NoneAPIErrorZ_get_ok(owner_conv); -} - -static inline struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return APIError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = CResult_NoneAPIErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) { - LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = CResult_NoneAPIErrorZ_clone(&orig->data[i]); - } - return ret; -} -static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) { - LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = APIError_clone(&orig->data[i]); - } - return ret; -} static jclass LDKCOption_ThirtyTwoBytesZ_Some_class = NULL; static jmethodID LDKCOption_ThirtyTwoBytesZ_Some_meth = NULL; static jclass LDKCOption_ThirtyTwoBytesZ_None_class = NULL; @@ -2380,266 +2282,905 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsN CResult_RecipientOnionFieldsNoneZ_get_err(owner_conv); } -static inline struct LDKUnsignedBolt12Invoice CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ - LDKUnsignedBolt12Invoice ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedBolt12InvoiceBolt12SemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); - LDKUnsignedBolt12Invoice ret_var = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_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 jclass LDKDNSResolverMessage_DNSSECQuery_class = NULL; +static jmethodID LDKDNSResolverMessage_DNSSECQuery_meth = NULL; +static jclass LDKDNSResolverMessage_DNSSECProof_class = NULL; +static jmethodID LDKDNSResolverMessage_DNSSECProof_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDNSResolverMessage_init (JNIEnv *env, jclass clz) { + LDKDNSResolverMessage_DNSSECQuery_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDNSResolverMessage$DNSSECQuery")); + CHECK(LDKDNSResolverMessage_DNSSECQuery_class != NULL); + LDKDNSResolverMessage_DNSSECQuery_meth = (*env)->GetMethodID(env, LDKDNSResolverMessage_DNSSECQuery_class, "", "(J)V"); + CHECK(LDKDNSResolverMessage_DNSSECQuery_meth != NULL); + LDKDNSResolverMessage_DNSSECProof_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDNSResolverMessage$DNSSECProof")); + CHECK(LDKDNSResolverMessage_DNSSECProof_class != NULL); + LDKDNSResolverMessage_DNSSECProof_meth = (*env)->GetMethodID(env, LDKDNSResolverMessage_DNSSECProof_class, "", "(J)V"); + CHECK(LDKDNSResolverMessage_DNSSECProof_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDNSResolverMessage_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKDNSResolverMessage *obj = (LDKDNSResolverMessage*)untag_ptr(ptr); + switch(obj->tag) { + case LDKDNSResolverMessage_DNSSECQuery: { + LDKDNSSECQuery dnssec_query_var = obj->dnssec_query; + int64_t dnssec_query_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(dnssec_query_var); + dnssec_query_ref = tag_ptr(dnssec_query_var.inner, false); + return (*env)->NewObject(env, LDKDNSResolverMessage_DNSSECQuery_class, LDKDNSResolverMessage_DNSSECQuery_meth, dnssec_query_ref); + } + case LDKDNSResolverMessage_DNSSECProof: { + LDKDNSSECProof dnssec_proof_var = obj->dnssec_proof; + int64_t dnssec_proof_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(dnssec_proof_var); + dnssec_proof_ref = tag_ptr(dnssec_proof_var.inner, false); + return (*env)->NewObject(env, LDKDNSResolverMessage_DNSSECProof_class, LDKDNSResolverMessage_DNSSECProof_meth, dnssec_proof_ref); + } + default: abort(); + } } - -static inline enum LDKBolt12SemanticError CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return Bolt12SemanticError_clone(&*owner->contents.err); +static inline struct LDKDNSResolverMessage C2Tuple_DNSResolverMessageResponseInstructionZ_get_a(LDKC2Tuple_DNSResolverMessageResponseInstructionZ *NONNULL_PTR owner){ + return DNSResolverMessage_clone(&owner->a); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedBolt12InvoiceBolt12SemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKBolt12SemanticError_to_java(env, CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(owner_conv)); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageResponseInstructionZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_DNSResolverMessageResponseInstructionZ* owner_conv = (LDKC2Tuple_DNSResolverMessageResponseInstructionZ*)untag_ptr(owner); + LDKDNSResolverMessage *ret_copy = MALLOC(sizeof(LDKDNSResolverMessage), "LDKDNSResolverMessage"); + *ret_copy = C2Tuple_DNSResolverMessageResponseInstructionZ_get_a(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline struct LDKBolt12Invoice CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ - LDKBolt12Invoice ret = *owner->contents.result; +static inline struct LDKResponseInstruction C2Tuple_DNSResolverMessageResponseInstructionZ_get_b(LDKC2Tuple_DNSResolverMessageResponseInstructionZ *NONNULL_PTR owner){ + LDKResponseInstruction ret = owner->b; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceBolt12SemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); - LDKBolt12Invoice ret_var = CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageResponseInstructionZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_DNSResolverMessageResponseInstructionZ* owner_conv = (LDKC2Tuple_DNSResolverMessageResponseInstructionZ*)untag_ptr(owner); + LDKResponseInstruction ret_var = C2Tuple_DNSResolverMessageResponseInstructionZ_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 enum LDKBolt12SemanticError CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return Bolt12SemanticError_clone(&*owner->contents.err); -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceBolt12SemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKBolt12SemanticError_to_java(env, CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline struct LDKSchnorrSignature CResult_SchnorrSignatureNoneZ_get_ok(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SchnorrSignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CResult_SchnorrSignatureNoneZ_get_ok(owner_conv).compact_form); - return ret_arr; -} - -static inline void CResult_SchnorrSignatureNoneZ_get_err(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SchnorrSignatureNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); - CResult_SchnorrSignatureNoneZ_get_err(owner_conv); +static jclass LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some_class = NULL; +static jmethodID LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some_meth = NULL; +static jclass LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None_class = NULL; +static jmethodID LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1DNSResolverMessageResponseInstructionZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ$Some")); + CHECK(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some_class != NULL); + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some_meth != NULL); + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ$None")); + CHECK(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None_class != NULL); + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None_class, "", "()V"); + CHECK(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None_meth != NULL); } - -static inline LDKCVec_ThirtyTwoBytesZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_ThirtyTwoBytesZ *orig) { - LDKCVec_ThirtyTwoBytesZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_ThirtyTwoBytesZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1DNSResolverMessageResponseInstructionZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ *obj = (LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some: { + LDKC2Tuple_DNSResolverMessageResponseInstructionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_DNSResolverMessageResponseInstructionZ), "LDKC2Tuple_DNSResolverMessageResponseInstructionZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_DNSResolverMessageResponseInstructionZ_clone(some_conv); + return (*env)->NewObject(env, LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some_class, LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some_meth, tag_ptr(some_conv, true)); + } + case LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None: { + return (*env)->NewObject(env, LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None_class, LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None_meth); + } + default: abort(); } - return ret; } -static jclass LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class = NULL; -static jmethodID LDKCOption_CVec_ThirtyTwoBytesZZ_Some_meth = NULL; -static jclass LDKCOption_CVec_ThirtyTwoBytesZZ_None_class = NULL; -static jmethodID LDKCOption_CVec_ThirtyTwoBytesZZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CVec_1ThirtyTwoBytesZZ_init (JNIEnv *env, jclass clz) { - LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_ThirtyTwoBytesZZ$Some")); - CHECK(LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class != NULL); - LDKCOption_CVec_ThirtyTwoBytesZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class, "", "([[B)V"); - CHECK(LDKCOption_CVec_ThirtyTwoBytesZZ_Some_meth != NULL); - LDKCOption_CVec_ThirtyTwoBytesZZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_ThirtyTwoBytesZZ$None")); - CHECK(LDKCOption_CVec_ThirtyTwoBytesZZ_None_class != NULL); - LDKCOption_CVec_ThirtyTwoBytesZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CVec_ThirtyTwoBytesZZ_None_class, "", "()V"); - CHECK(LDKCOption_CVec_ThirtyTwoBytesZZ_None_meth != NULL); +static jclass LDKDestination_Node_class = NULL; +static jmethodID LDKDestination_Node_meth = NULL; +static jclass LDKDestination_BlindedPath_class = NULL; +static jmethodID LDKDestination_BlindedPath_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDestination_init (JNIEnv *env, jclass clz) { + LDKDestination_Node_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$Node")); + CHECK(LDKDestination_Node_class != NULL); + LDKDestination_Node_meth = (*env)->GetMethodID(env, LDKDestination_Node_class, "", "([B)V"); + CHECK(LDKDestination_Node_meth != NULL); + LDKDestination_BlindedPath_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$BlindedPath")); + CHECK(LDKDestination_BlindedPath_class != NULL); + LDKDestination_BlindedPath_meth = (*env)->GetMethodID(env, LDKDestination_BlindedPath_class, "", "(J)V"); + CHECK(LDKDestination_BlindedPath_meth != NULL); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1ThirtyTwoBytesZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_CVec_ThirtyTwoBytesZZ *obj = (LDKCOption_CVec_ThirtyTwoBytesZZ*)untag_ptr(ptr); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKDestination *obj = (LDKDestination*)untag_ptr(ptr); switch(obj->tag) { - case LDKCOption_CVec_ThirtyTwoBytesZZ_Some: { - LDKCVec_ThirtyTwoBytesZ some_var = obj->some; - jobjectArray some_arr = NULL; - some_arr = (*env)->NewObjectArray(env, some_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < some_var.datalen; i++) { - int8_tArray some_conv_8_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, some_conv_8_arr, 0, 32, some_var.data[i].data); - (*env)->SetObjectArrayElement(env, some_arr, i, some_conv_8_arr); - } - - return (*env)->NewObject(env, LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class, LDKCOption_CVec_ThirtyTwoBytesZZ_Some_meth, some_arr); + case LDKDestination_Node: { + int8_tArray node_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, node_arr, 0, 33, obj->node.compressed_form); + return (*env)->NewObject(env, LDKDestination_Node_class, LDKDestination_Node_meth, node_arr); } - case LDKCOption_CVec_ThirtyTwoBytesZZ_None: { - return (*env)->NewObject(env, LDKCOption_CVec_ThirtyTwoBytesZZ_None_class, LDKCOption_CVec_ThirtyTwoBytesZZ_None_meth); + case LDKDestination_BlindedPath: { + 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); + return (*env)->NewObject(env, LDKDestination_BlindedPath_class, LDKDestination_BlindedPath_meth, blinded_path_ref); } default: abort(); } } -static jclass LDKAmount_Bitcoin_class = NULL; -static jmethodID LDKAmount_Bitcoin_meth = NULL; -static jclass LDKAmount_Currency_class = NULL; -static jmethodID LDKAmount_Currency_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAmount_init (JNIEnv *env, jclass clz) { - LDKAmount_Bitcoin_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAmount$Bitcoin")); - CHECK(LDKAmount_Bitcoin_class != NULL); - LDKAmount_Bitcoin_meth = (*env)->GetMethodID(env, LDKAmount_Bitcoin_class, "", "(J)V"); - CHECK(LDKAmount_Bitcoin_meth != NULL); - LDKAmount_Currency_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAmount$Currency")); - CHECK(LDKAmount_Currency_class != NULL); - LDKAmount_Currency_meth = (*env)->GetMethodID(env, LDKAmount_Currency_class, "", "([BJ)V"); - CHECK(LDKAmount_Currency_meth != NULL); +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, "", "([BJ[B)V"); + CHECK(LDKOffersContext_InboundPayment_meth != NULL); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAmount_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKAmount *obj = (LDKAmount*)untag_ptr(ptr); +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 LDKAmount_Bitcoin: { - int64_t amount_msats_conv = obj->bitcoin.amount_msats; - return (*env)->NewObject(env, LDKAmount_Bitcoin_class, LDKAmount_Bitcoin_meth, amount_msats_conv); + 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 LDKAmount_Currency: { - int8_tArray iso4217_code_arr = (*env)->NewByteArray(env, 3); - (*env)->SetByteArrayRegion(env, iso4217_code_arr, 0, 3, obj->currency.iso4217_code.data); - int64_t amount_conv = obj->currency.amount; - return (*env)->NewObject(env, LDKAmount_Currency_class, LDKAmount_Currency_meth, iso4217_code_arr, amount_conv); + 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); + LDKNonce nonce_var = obj->inbound_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->inbound_payment.hmac.data); + return (*env)->NewObject(env, LDKOffersContext_InboundPayment_class, LDKOffersContext_InboundPayment_meth, payment_hash_arr, nonce_ref, hmac_arr); } default: abort(); } } -static jclass LDKCOption_AmountZ_Some_class = NULL; -static jmethodID LDKCOption_AmountZ_Some_meth = NULL; -static jclass LDKCOption_AmountZ_None_class = NULL; -static jmethodID LDKCOption_AmountZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1AmountZ_init (JNIEnv *env, jclass clz) { - LDKCOption_AmountZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AmountZ$Some")); - CHECK(LDKCOption_AmountZ_Some_class != NULL); - LDKCOption_AmountZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_AmountZ_Some_class, "", "(J)V"); - CHECK(LDKCOption_AmountZ_Some_meth != NULL); - LDKCOption_AmountZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AmountZ$None")); - CHECK(LDKCOption_AmountZ_None_class != NULL); - LDKCOption_AmountZ_None_meth = (*env)->GetMethodID(env, LDKCOption_AmountZ_None_class, "", "()V"); - CHECK(LDKCOption_AmountZ_None_meth != NULL); +static jclass LDKAsyncPaymentsContext_OutboundPayment_class = NULL; +static jmethodID LDKAsyncPaymentsContext_OutboundPayment_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAsyncPaymentsContext_init (JNIEnv *env, jclass clz) { + LDKAsyncPaymentsContext_OutboundPayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAsyncPaymentsContext$OutboundPayment")); + CHECK(LDKAsyncPaymentsContext_OutboundPayment_class != NULL); + LDKAsyncPaymentsContext_OutboundPayment_meth = (*env)->GetMethodID(env, LDKAsyncPaymentsContext_OutboundPayment_class, "", "([BJ[B)V"); + CHECK(LDKAsyncPaymentsContext_OutboundPayment_meth != NULL); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1AmountZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_AmountZ *obj = (LDKCOption_AmountZ*)untag_ptr(ptr); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAsyncPaymentsContext_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKAsyncPaymentsContext *obj = (LDKAsyncPaymentsContext*)untag_ptr(ptr); switch(obj->tag) { - case LDKCOption_AmountZ_Some: { - int64_t some_ref = tag_ptr(&obj->some, false); - return (*env)->NewObject(env, LDKCOption_AmountZ_Some_class, LDKCOption_AmountZ_Some_meth, some_ref); - } - case LDKCOption_AmountZ_None: { - return (*env)->NewObject(env, LDKCOption_AmountZ_None_class, LDKCOption_AmountZ_None_meth); + case LDKAsyncPaymentsContext_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, LDKAsyncPaymentsContext_OutboundPayment_class, LDKAsyncPaymentsContext_OutboundPayment_meth, payment_id_arr, nonce_ref, hmac_arr); } default: abort(); } } -static jclass LDKQuantity_Bounded_class = NULL; -static jmethodID LDKQuantity_Bounded_meth = NULL; -static jclass LDKQuantity_Unbounded_class = NULL; -static jmethodID LDKQuantity_Unbounded_meth = NULL; -static jclass LDKQuantity_One_class = NULL; -static jmethodID LDKQuantity_One_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKQuantity_init (JNIEnv *env, jclass clz) { - LDKQuantity_Bounded_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKQuantity$Bounded")); - CHECK(LDKQuantity_Bounded_class != NULL); - LDKQuantity_Bounded_meth = (*env)->GetMethodID(env, LDKQuantity_Bounded_class, "", "(J)V"); - CHECK(LDKQuantity_Bounded_meth != NULL); - LDKQuantity_Unbounded_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKQuantity$Unbounded")); - CHECK(LDKQuantity_Unbounded_class != NULL); - LDKQuantity_Unbounded_meth = (*env)->GetMethodID(env, LDKQuantity_Unbounded_class, "", "()V"); - CHECK(LDKQuantity_Unbounded_meth != NULL); - LDKQuantity_One_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKQuantity$One")); - CHECK(LDKQuantity_One_class != NULL); - LDKQuantity_One_meth = (*env)->GetMethodID(env, LDKQuantity_One_class, "", "()V"); - CHECK(LDKQuantity_One_meth != NULL); +static jclass LDKMessageContext_Offers_class = NULL; +static jmethodID LDKMessageContext_Offers_meth = NULL; +static jclass LDKMessageContext_AsyncPayments_class = NULL; +static jmethodID LDKMessageContext_AsyncPayments_meth = NULL; +static jclass LDKMessageContext_DNSResolver_class = NULL; +static jmethodID LDKMessageContext_DNSResolver_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_AsyncPayments_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageContext$AsyncPayments")); + CHECK(LDKMessageContext_AsyncPayments_class != NULL); + LDKMessageContext_AsyncPayments_meth = (*env)->GetMethodID(env, LDKMessageContext_AsyncPayments_class, "", "(J)V"); + CHECK(LDKMessageContext_AsyncPayments_meth != NULL); + LDKMessageContext_DNSResolver_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageContext$DNSResolver")); + CHECK(LDKMessageContext_DNSResolver_class != NULL); + LDKMessageContext_DNSResolver_meth = (*env)->GetMethodID(env, LDKMessageContext_DNSResolver_class, "", "(J)V"); + CHECK(LDKMessageContext_DNSResolver_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_LDKQuantity_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKQuantity *obj = (LDKQuantity*)untag_ptr(ptr); +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 LDKQuantity_Bounded: { - int64_t bounded_conv = obj->bounded; - return (*env)->NewObject(env, LDKQuantity_Bounded_class, LDKQuantity_Bounded_meth, bounded_conv); + 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 LDKQuantity_Unbounded: { - return (*env)->NewObject(env, LDKQuantity_Unbounded_class, LDKQuantity_Unbounded_meth); + case LDKMessageContext_AsyncPayments: { + int64_t async_payments_ref = tag_ptr(&obj->async_payments, false); + return (*env)->NewObject(env, LDKMessageContext_AsyncPayments_class, LDKMessageContext_AsyncPayments_meth, async_payments_ref); } - case LDKQuantity_One: { - return (*env)->NewObject(env, LDKQuantity_One_class, LDKQuantity_One_meth); + case LDKMessageContext_DNSResolver: { + LDKDNSResolverContext dns_resolver_var = obj->dns_resolver; + int64_t dns_resolver_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(dns_resolver_var); + dns_resolver_ref = tag_ptr(dns_resolver_var.inner, false); + return (*env)->NewObject(env, LDKMessageContext_DNSResolver_class, LDKMessageContext_DNSResolver_meth, dns_resolver_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 LDKCOption_QuantityZ_Some_class = NULL; -static jmethodID LDKCOption_QuantityZ_Some_meth = NULL; -static jclass LDKCOption_QuantityZ_None_class = NULL; -static jmethodID LDKCOption_QuantityZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1QuantityZ_init (JNIEnv *env, jclass clz) { - LDKCOption_QuantityZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_QuantityZ$Some")); - CHECK(LDKCOption_QuantityZ_Some_class != NULL); - LDKCOption_QuantityZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_QuantityZ_Some_class, "", "(J)V"); - CHECK(LDKCOption_QuantityZ_Some_meth != NULL); - LDKCOption_QuantityZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_QuantityZ$None")); - CHECK(LDKCOption_QuantityZ_None_class != NULL); - LDKCOption_QuantityZ_None_meth = (*env)->GetMethodID(env, LDKCOption_QuantityZ_None_class, "", "()V"); - CHECK(LDKCOption_QuantityZ_None_meth != NULL); +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_LDKCOption_1QuantityZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_QuantityZ *obj = (LDKCOption_QuantityZ*)untag_ptr(ptr); +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 LDKCOption_QuantityZ_Some: { - int64_t some_ref = tag_ptr(&obj->some, false); - return (*env)->NewObject(env, LDKCOption_QuantityZ_Some_class, LDKCOption_QuantityZ_Some_meth, some_ref); + 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 LDKCOption_QuantityZ_None: { - return (*env)->NewObject(env, LDKCOption_QuantityZ_None_class, LDKCOption_QuantityZ_None_meth); + 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 LDKThirtyTwoBytes CResult_ThirtyTwoBytesNoneZ_get_ok(LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return ThirtyTwoBytes_clone(&*owner->contents.result); +static inline struct LDKDNSResolverMessage C2Tuple_DNSResolverMessageMessageSendInstructionsZ_get_a(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ *NONNULL_PTR owner){ + return DNSResolverMessage_clone(&owner->a); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ThirtyTwoBytesNoneZ* owner_conv = (LDKCResult_ThirtyTwoBytesNoneZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_ThirtyTwoBytesNoneZ_get_ok(owner_conv).data); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageMessageSendInstructionsZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ*)untag_ptr(owner); + LDKDNSResolverMessage *ret_copy = MALLOC(sizeof(LDKDNSResolverMessage), "LDKDNSResolverMessage"); + *ret_copy = C2Tuple_DNSResolverMessageMessageSendInstructionsZ_get_a(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline void CResult_ThirtyTwoBytesNoneZ_get_err(LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; +static inline struct LDKMessageSendInstructions C2Tuple_DNSResolverMessageMessageSendInstructionsZ_get_b(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ *NONNULL_PTR owner){ + return MessageSendInstructions_clone(&owner->b); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ThirtyTwoBytesNoneZ* owner_conv = (LDKCResult_ThirtyTwoBytesNoneZ*)untag_ptr(owner); - CResult_ThirtyTwoBytesNoneZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageMessageSendInstructionsZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ*)untag_ptr(owner); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = C2Tuple_DNSResolverMessageMessageSendInstructionsZ_get_b(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ CVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ_clone(const LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ *orig) { + LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ) * orig->datalen, "LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_DNSResolverMessageMessageSendInstructionsZ_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKDNSResolverMessage CResult_DNSResolverMessageDecodeErrorZ_get_ok(LDKCResult_DNSResolverMessageDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return DNSResolverMessage_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_DNSResolverMessageDecodeErrorZ* owner_conv = (LDKCResult_DNSResolverMessageDecodeErrorZ*)untag_ptr(owner); + LDKDNSResolverMessage *ret_copy = MALLOC(sizeof(LDKDNSResolverMessage), "LDKDNSResolverMessage"); + *ret_copy = CResult_DNSResolverMessageDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_DNSResolverMessageDecodeErrorZ_get_err(LDKCResult_DNSResolverMessageDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_DNSResolverMessageDecodeErrorZ* owner_conv = (LDKCResult_DNSResolverMessageDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_DNSResolverMessageDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKHumanReadableName CResult_HumanReadableNameNoneZ_get_ok(LDKCResult_HumanReadableNameNoneZ *NONNULL_PTR owner){ + LDKHumanReadableName ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_HumanReadableNameNoneZ* owner_conv = (LDKCResult_HumanReadableNameNoneZ*)untag_ptr(owner); + LDKHumanReadableName ret_var = CResult_HumanReadableNameNoneZ_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_HumanReadableNameNoneZ_get_err(LDKCResult_HumanReadableNameNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_HumanReadableNameNoneZ* owner_conv = (LDKCResult_HumanReadableNameNoneZ*)untag_ptr(owner); + CResult_HumanReadableNameNoneZ_get_err(owner_conv); +} + +static inline struct LDKHumanReadableName CResult_HumanReadableNameDecodeErrorZ_get_ok(LDKCResult_HumanReadableNameDecodeErrorZ *NONNULL_PTR owner){ + LDKHumanReadableName ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_HumanReadableNameDecodeErrorZ* owner_conv = (LDKCResult_HumanReadableNameDecodeErrorZ*)untag_ptr(owner); + LDKHumanReadableName ret_var = CResult_HumanReadableNameDecodeErrorZ_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_HumanReadableNameDecodeErrorZ_get_err(LDKCResult_HumanReadableNameDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_HumanReadableNameDecodeErrorZ* owner_conv = (LDKCResult_HumanReadableNameDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_HumanReadableNameDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDNSSECQuery C2Tuple_DNSSECQueryDNSResolverContextZ_get_a(LDKC2Tuple_DNSSECQueryDNSResolverContextZ *NONNULL_PTR owner){ + LDKDNSSECQuery ret = owner->a; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSSECQueryDNSResolverContextZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_DNSSECQueryDNSResolverContextZ* owner_conv = (LDKC2Tuple_DNSSECQueryDNSResolverContextZ*)untag_ptr(owner); + LDKDNSSECQuery ret_var = C2Tuple_DNSSECQueryDNSResolverContextZ_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 LDKDNSResolverContext C2Tuple_DNSSECQueryDNSResolverContextZ_get_b(LDKC2Tuple_DNSSECQueryDNSResolverContextZ *NONNULL_PTR owner){ + LDKDNSResolverContext ret = owner->b; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSSECQueryDNSResolverContextZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_DNSSECQueryDNSResolverContextZ* owner_conv = (LDKC2Tuple_DNSSECQueryDNSResolverContextZ*)untag_ptr(owner); + LDKDNSResolverContext ret_var = C2Tuple_DNSSECQueryDNSResolverContextZ_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 LDKC2Tuple_DNSSECQueryDNSResolverContextZ CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_get_ok(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return C2Tuple_DNSSECQueryDNSResolverContextZ_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* owner_conv = (LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ*)untag_ptr(owner); + LDKC2Tuple_DNSSECQueryDNSResolverContextZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSSECQueryDNSResolverContextZ), "LDKC2Tuple_DNSSECQueryDNSResolverContextZ"); + *ret_conv = CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_get_ok(owner_conv); + return tag_ptr(ret_conv, true); +} + +static inline void CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_get_err(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* owner_conv = (LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ*)untag_ptr(owner); + CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_get_err(owner_conv); +} + +static inline struct LDKHumanReadableName C2Tuple_HumanReadableNameThirtyTwoBytesZ_get_a(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ *NONNULL_PTR owner){ + LDKHumanReadableName ret = owner->a; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HumanReadableNameThirtyTwoBytesZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ* owner_conv = (LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)untag_ptr(owner); + LDKHumanReadableName ret_var = C2Tuple_HumanReadableNameThirtyTwoBytesZ_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 LDKThirtyTwoBytes C2Tuple_HumanReadableNameThirtyTwoBytesZ_get_b(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ *NONNULL_PTR owner){ + return ThirtyTwoBytes_clone(&owner->b); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HumanReadableNameThirtyTwoBytesZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ* owner_conv = (LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_HumanReadableNameThirtyTwoBytesZ_get_b(owner_conv).data); + return ret_arr; +} + +static inline LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ_clone(const LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ *orig) { + LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ) * orig->datalen, "LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_get_a(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ *NONNULL_PTR owner){ + return CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ_clone(&owner->a); +} +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ* owner_conv = (LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ*)untag_ptr(owner); + LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ ret_var = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_get_a(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++) { + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ* ret_conv_43_conv = MALLOC(sizeof(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ), "LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ"); + *ret_conv_43_conv = ret_var.data[r]; + ret_arr_ptr[r] = tag_ptr(ret_conv_43_conv, true); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +static inline struct LDKOffer C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_get_b(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ *NONNULL_PTR owner){ + LDKOffer ret = owner->b; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ* owner_conv = (LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ*)untag_ptr(owner); + LDKOffer ret_var = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some_class = NULL; +static jmethodID LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some_meth = NULL; +static jclass LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None_class = NULL; +static jmethodID LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ$Some")); + CHECK(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some_class != NULL); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some_meth != NULL); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ$None")); + CHECK(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None_class != NULL); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None_class, "", "()V"); + CHECK(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ *obj = (LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some: { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ* some_conv = MALLOC(sizeof(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ), "LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone(some_conv); + return (*env)->NewObject(env, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some_class, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some_meth, tag_ptr(some_conv, true)); + } + case LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None: { + return (*env)->NewObject(env, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None_class, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None_meth); + } + default: abort(); + } +} +static inline struct LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_get_a(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ *NONNULL_PTR owner){ + return CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ_clone(&owner->a); +} +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ* owner_conv = (LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ*)untag_ptr(owner); + LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ ret_var = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_get_a(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++) { + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ* ret_conv_43_conv = MALLOC(sizeof(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ), "LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ"); + *ret_conv_43_conv = ret_var.data[r]; + ret_arr_ptr[r] = tag_ptr(ret_conv_43_conv, true); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +static inline struct LDKStr C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_get_b(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ *NONNULL_PTR owner){ + return owner->b; +} +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ* owner_conv = (LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ*)untag_ptr(owner); + LDKStr ret_str = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_get_b(owner_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + return ret_conv; +} + +static jclass LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some_class = NULL; +static jmethodID LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some_meth = NULL; +static jclass LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None_class = NULL; +static jmethodID LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ$Some")); + CHECK(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some_class != NULL); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some_meth != NULL); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ$None")); + CHECK(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None_class != NULL); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None_class, "", "()V"); + CHECK(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ *obj = (LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some: { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ* some_conv = MALLOC(sizeof(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ), "LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone(some_conv); + return (*env)->NewObject(env, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some_class, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some_meth, tag_ptr(some_conv, true)); + } + case LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None: { + return (*env)->NewObject(env, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None_class, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None_meth); + } + default: abort(); + } +} +static inline struct LDKUnsignedBolt12Invoice CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKUnsignedBolt12Invoice ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedBolt12InvoiceBolt12SemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + LDKUnsignedBolt12Invoice ret_var = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_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 enum LDKBolt12SemanticError CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedBolt12InvoiceBolt12SemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKBolt12SemanticError_to_java(env, CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKBolt12Invoice CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKBolt12Invoice ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceBolt12SemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + LDKBolt12Invoice ret_var = CResult_Bolt12InvoiceBolt12SemanticErrorZ_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 enum LDKBolt12SemanticError CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceBolt12SemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKBolt12SemanticError_to_java(env, CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKSchnorrSignature CResult_SchnorrSignatureNoneZ_get_ok(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SchnorrSignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CResult_SchnorrSignatureNoneZ_get_ok(owner_conv).compact_form); + return ret_arr; +} + +static inline void CResult_SchnorrSignatureNoneZ_get_err(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SchnorrSignatureNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); + CResult_SchnorrSignatureNoneZ_get_err(owner_conv); +} + +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] = BlindedPaymentPath_clone(&orig->data[i]); + } + return ret; +} +static inline LDKCVec_ThirtyTwoBytesZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_ThirtyTwoBytesZ *orig) { + LDKCVec_ThirtyTwoBytesZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_ThirtyTwoBytesZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]); + } + return ret; +} +static jclass LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class = NULL; +static jmethodID LDKCOption_CVec_ThirtyTwoBytesZZ_Some_meth = NULL; +static jclass LDKCOption_CVec_ThirtyTwoBytesZZ_None_class = NULL; +static jmethodID LDKCOption_CVec_ThirtyTwoBytesZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CVec_1ThirtyTwoBytesZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_ThirtyTwoBytesZZ$Some")); + CHECK(LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class != NULL); + LDKCOption_CVec_ThirtyTwoBytesZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class, "", "([[B)V"); + CHECK(LDKCOption_CVec_ThirtyTwoBytesZZ_Some_meth != NULL); + LDKCOption_CVec_ThirtyTwoBytesZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_ThirtyTwoBytesZZ$None")); + CHECK(LDKCOption_CVec_ThirtyTwoBytesZZ_None_class != NULL); + LDKCOption_CVec_ThirtyTwoBytesZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CVec_ThirtyTwoBytesZZ_None_class, "", "()V"); + CHECK(LDKCOption_CVec_ThirtyTwoBytesZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1ThirtyTwoBytesZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_CVec_ThirtyTwoBytesZZ *obj = (LDKCOption_CVec_ThirtyTwoBytesZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_CVec_ThirtyTwoBytesZZ_Some: { + LDKCVec_ThirtyTwoBytesZ some_var = obj->some; + jobjectArray some_arr = NULL; + some_arr = (*env)->NewObjectArray(env, some_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < some_var.datalen; i++) { + int8_tArray some_conv_8_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, some_conv_8_arr, 0, 32, some_var.data[i].data); + (*env)->SetObjectArrayElement(env, some_arr, i, some_conv_8_arr); + } + + return (*env)->NewObject(env, LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class, LDKCOption_CVec_ThirtyTwoBytesZZ_Some_meth, some_arr); + } + case LDKCOption_CVec_ThirtyTwoBytesZZ_None: { + return (*env)->NewObject(env, LDKCOption_CVec_ThirtyTwoBytesZZ_None_class, LDKCOption_CVec_ThirtyTwoBytesZZ_None_meth); + } + default: abort(); + } +} +static jclass LDKAmount_Bitcoin_class = NULL; +static jmethodID LDKAmount_Bitcoin_meth = NULL; +static jclass LDKAmount_Currency_class = NULL; +static jmethodID LDKAmount_Currency_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAmount_init (JNIEnv *env, jclass clz) { + LDKAmount_Bitcoin_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAmount$Bitcoin")); + CHECK(LDKAmount_Bitcoin_class != NULL); + LDKAmount_Bitcoin_meth = (*env)->GetMethodID(env, LDKAmount_Bitcoin_class, "", "(J)V"); + CHECK(LDKAmount_Bitcoin_meth != NULL); + LDKAmount_Currency_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAmount$Currency")); + CHECK(LDKAmount_Currency_class != NULL); + LDKAmount_Currency_meth = (*env)->GetMethodID(env, LDKAmount_Currency_class, "", "([BJ)V"); + CHECK(LDKAmount_Currency_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAmount_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKAmount *obj = (LDKAmount*)untag_ptr(ptr); + switch(obj->tag) { + case LDKAmount_Bitcoin: { + int64_t amount_msats_conv = obj->bitcoin.amount_msats; + return (*env)->NewObject(env, LDKAmount_Bitcoin_class, LDKAmount_Bitcoin_meth, amount_msats_conv); + } + case LDKAmount_Currency: { + int8_tArray iso4217_code_arr = (*env)->NewByteArray(env, 3); + (*env)->SetByteArrayRegion(env, iso4217_code_arr, 0, 3, obj->currency.iso4217_code.data); + int64_t amount_conv = obj->currency.amount; + return (*env)->NewObject(env, LDKAmount_Currency_class, LDKAmount_Currency_meth, iso4217_code_arr, amount_conv); + } + default: abort(); + } +} +static jclass LDKCOption_AmountZ_Some_class = NULL; +static jmethodID LDKCOption_AmountZ_Some_meth = NULL; +static jclass LDKCOption_AmountZ_None_class = NULL; +static jmethodID LDKCOption_AmountZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1AmountZ_init (JNIEnv *env, jclass clz) { + LDKCOption_AmountZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AmountZ$Some")); + CHECK(LDKCOption_AmountZ_Some_class != NULL); + LDKCOption_AmountZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_AmountZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_AmountZ_Some_meth != NULL); + LDKCOption_AmountZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AmountZ$None")); + CHECK(LDKCOption_AmountZ_None_class != NULL); + LDKCOption_AmountZ_None_meth = (*env)->GetMethodID(env, LDKCOption_AmountZ_None_class, "", "()V"); + CHECK(LDKCOption_AmountZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1AmountZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_AmountZ *obj = (LDKCOption_AmountZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_AmountZ_Some: { + int64_t some_ref = tag_ptr(&obj->some, false); + return (*env)->NewObject(env, LDKCOption_AmountZ_Some_class, LDKCOption_AmountZ_Some_meth, some_ref); + } + case LDKCOption_AmountZ_None: { + return (*env)->NewObject(env, LDKCOption_AmountZ_None_class, LDKCOption_AmountZ_None_meth); + } + default: abort(); + } +} +static jclass LDKQuantity_Bounded_class = NULL; +static jmethodID LDKQuantity_Bounded_meth = NULL; +static jclass LDKQuantity_Unbounded_class = NULL; +static jmethodID LDKQuantity_Unbounded_meth = NULL; +static jclass LDKQuantity_One_class = NULL; +static jmethodID LDKQuantity_One_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKQuantity_init (JNIEnv *env, jclass clz) { + LDKQuantity_Bounded_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKQuantity$Bounded")); + CHECK(LDKQuantity_Bounded_class != NULL); + LDKQuantity_Bounded_meth = (*env)->GetMethodID(env, LDKQuantity_Bounded_class, "", "(J)V"); + CHECK(LDKQuantity_Bounded_meth != NULL); + LDKQuantity_Unbounded_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKQuantity$Unbounded")); + CHECK(LDKQuantity_Unbounded_class != NULL); + LDKQuantity_Unbounded_meth = (*env)->GetMethodID(env, LDKQuantity_Unbounded_class, "", "()V"); + CHECK(LDKQuantity_Unbounded_meth != NULL); + LDKQuantity_One_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKQuantity$One")); + CHECK(LDKQuantity_One_class != NULL); + LDKQuantity_One_meth = (*env)->GetMethodID(env, LDKQuantity_One_class, "", "()V"); + CHECK(LDKQuantity_One_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKQuantity_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKQuantity *obj = (LDKQuantity*)untag_ptr(ptr); + switch(obj->tag) { + case LDKQuantity_Bounded: { + int64_t bounded_conv = obj->bounded; + return (*env)->NewObject(env, LDKQuantity_Bounded_class, LDKQuantity_Bounded_meth, bounded_conv); + } + case LDKQuantity_Unbounded: { + return (*env)->NewObject(env, LDKQuantity_Unbounded_class, LDKQuantity_Unbounded_meth); + } + case LDKQuantity_One: { + return (*env)->NewObject(env, LDKQuantity_One_class, LDKQuantity_One_meth); + } + default: abort(); + } +} +static jclass LDKCOption_QuantityZ_Some_class = NULL; +static jmethodID LDKCOption_QuantityZ_Some_meth = NULL; +static jclass LDKCOption_QuantityZ_None_class = NULL; +static jmethodID LDKCOption_QuantityZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1QuantityZ_init (JNIEnv *env, jclass clz) { + LDKCOption_QuantityZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_QuantityZ$Some")); + CHECK(LDKCOption_QuantityZ_Some_class != NULL); + LDKCOption_QuantityZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_QuantityZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_QuantityZ_Some_meth != NULL); + LDKCOption_QuantityZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_QuantityZ$None")); + CHECK(LDKCOption_QuantityZ_None_class != NULL); + LDKCOption_QuantityZ_None_meth = (*env)->GetMethodID(env, LDKCOption_QuantityZ_None_class, "", "()V"); + CHECK(LDKCOption_QuantityZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1QuantityZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_QuantityZ *obj = (LDKCOption_QuantityZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_QuantityZ_Some: { + int64_t some_ref = tag_ptr(&obj->some, false); + return (*env)->NewObject(env, LDKCOption_QuantityZ_Some_class, LDKCOption_QuantityZ_Some_meth, some_ref); + } + case LDKCOption_QuantityZ_None: { + return (*env)->NewObject(env, LDKCOption_QuantityZ_None_class, LDKCOption_QuantityZ_None_meth); + } + default: abort(); + } +} +static inline struct LDKThirtyTwoBytes CResult_ThirtyTwoBytesNoneZ_get_ok(LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return ThirtyTwoBytes_clone(&*owner->contents.result); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ThirtyTwoBytesNoneZ* owner_conv = (LDKCResult_ThirtyTwoBytesNoneZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_ThirtyTwoBytesNoneZ_get_ok(owner_conv).data); + return ret_arr; +} + +static inline void CResult_ThirtyTwoBytesNoneZ_get_err(LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ThirtyTwoBytesNoneZ* owner_conv = (LDKCResult_ThirtyTwoBytesNoneZ*)untag_ptr(owner); + CResult_ThirtyTwoBytesNoneZ_get_err(owner_conv); } static inline struct LDKBolt12Invoice CResult_Bolt12InvoiceDecodeErrorZ_get_ok(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR owner){ @@ -3480,6 +4021,7 @@ typedef struct LDKEcdsaChannelSigner_JCalls { jmethodID sign_closing_transaction_meth; jmethodID sign_holder_anchor_input_meth; jmethodID sign_channel_announcement_with_funding_key_meth; + jmethodID sign_splicing_funding_input_meth; } LDKEcdsaChannelSigner_JCalls; static void LDKEcdsaChannelSigner_JCalls_free(void* this_arg) { LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg; @@ -3814,6 +4356,37 @@ LDKCResult_ECDSASignatureNoneZ sign_channel_announcement_with_funding_key_LDKEcd } return ret_conv; } +LDKCResult_ECDSASignatureNoneZ sign_splicing_funding_input_LDKEcdsaChannelSigner_jcall(const void* this_arg, LDKTransaction tx, uintptr_t input_index, uint64_t input_value) { + LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_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); + } + LDKTransaction tx_var = tx; + int8_tArray tx_arr = (*env)->NewByteArray(env, tx_var.datalen); + (*env)->SetByteArrayRegion(env, tx_arr, 0, tx_var.datalen, tx_var.data); + Transaction_free(tx_var); + int64_t input_index_conv = input_index; + int64_t input_value_conv = input_value; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_splicing_funding_input_meth, tx_arr, input_index_conv, input_value_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to sign_splicing_funding_input in LDKEcdsaChannelSigner from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_ECDSASignatureNoneZ ret_conv = *(LDKCResult_ECDSASignatureNoneZ*)(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 LDKEcdsaChannelSigner_JCalls_cloned(LDKEcdsaChannelSigner* new_obj) { LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) new_obj->this_arg; atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); @@ -3844,6 +4417,8 @@ static inline LDKEcdsaChannelSigner LDKEcdsaChannelSigner_init (JNIEnv *env, jcl CHECK(calls->sign_holder_anchor_input_meth != NULL); calls->sign_channel_announcement_with_funding_key_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement_with_funding_key", "(J)J"); CHECK(calls->sign_channel_announcement_with_funding_key_meth != NULL); + calls->sign_splicing_funding_input_meth = (*env)->GetMethodID(env, c, "sign_splicing_funding_input", "([BJJ)J"); + CHECK(calls->sign_splicing_funding_input_meth != NULL); LDKChannelPublicKeys pubkeys_conv; pubkeys_conv.inner = untag_ptr(pubkeys); @@ -3861,6 +4436,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, + .sign_splicing_funding_input = sign_splicing_funding_input_LDKEcdsaChannelSigner_jcall, .cloned = LDKEcdsaChannelSigner_JCalls_cloned, .free = LDKEcdsaChannelSigner_JCalls_free, .ChannelSigner = LDKChannelSigner_init(env, clz, ChannelSigner, pubkeys), @@ -4055,6 +4631,20 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1sign_1c return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1sign_1splicing_1funding_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray tx, int64_t input_index, int64_t input_value) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr; + LDKTransaction tx_ref; + tx_ref.datalen = (*env)->GetArrayLength(env, tx); + tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, tx, 0, tx_ref.datalen, tx_ref.data); + tx_ref.data_is_owned = true; + LDKCResult_ECDSASignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ECDSASignatureNoneZ), "LDKCResult_ECDSASignatureNoneZ"); + *ret_conv = (this_arg_conv->sign_splicing_funding_input)(this_arg_conv->this_arg, tx_ref, input_index, input_value); + return tag_ptr(ret_conv, true); +} + static inline struct LDKEcdsaChannelSigner CResult_EcdsaChannelSignerDecodeErrorZ_get_ok(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return EcdsaChannelSigner_clone(&*owner->contents.result); @@ -5024,13 +5614,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErro return ret_ref; } -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] = BlindedPaymentPath_clone(&orig->data[i]); - } - return ret; -} static inline struct LDKCVec_BlindedPaymentPathZ CResult_CVec_BlindedPaymentPathZNoneZ_get_ok(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return CVec_BlindedPaymentPathZ_clone(&*owner->contents.result); @@ -5062,67 +5645,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentP CResult_CVec_BlindedPaymentPathZNoneZ_get_err(owner_conv); } -static inline struct LDKOnionMessagePath CResult_OnionMessagePathNoneZ_get_ok(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner){ - LDKOnionMessagePath ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_OnionMessagePathNoneZ* owner_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(owner); - LDKOnionMessagePath ret_var = CResult_OnionMessagePathNoneZ_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_OnionMessagePathNoneZ_get_err(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_OnionMessagePathNoneZ* owner_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(owner); - CResult_OnionMessagePathNoneZ_get_err(owner_conv); -} - -static inline struct LDKCVec_BlindedMessagePathZ CResult_CVec_BlindedMessagePathZNoneZ_get_ok(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return CVec_BlindedMessagePathZ_clone(&*owner->contents.result); -} -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 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_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_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; @@ -6056,188 +6578,6 @@ static inline LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ CVe } return ret; } -static inline struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKInitFeatures ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKInitFeatures ret_var = CResult_InitFeaturesDecodeErrorZ_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_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKChannelFeatures ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKChannelFeatures ret_var = CResult_ChannelFeaturesDecodeErrorZ_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_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKNodeFeatures ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKNodeFeatures ret_var = CResult_NodeFeaturesDecodeErrorZ_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_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKBolt11InvoiceFeatures CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKBolt11InvoiceFeatures ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKBolt11InvoiceFeatures ret_var = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_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_Bolt11InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKBolt12InvoiceFeatures CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKBolt12InvoiceFeatures ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKBolt12InvoiceFeatures ret_var = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_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_Bolt12InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKBlindedHopFeatures CResult_BlindedHopFeaturesDecodeErrorZ_get_ok(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKBlindedHopFeatures ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedHopFeaturesDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKBlindedHopFeatures ret_var = CResult_BlindedHopFeaturesDecodeErrorZ_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_BlindedHopFeaturesDecodeErrorZ_get_err(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedHopFeaturesDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedHopFeaturesDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKChannelTypeFeatures ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKChannelTypeFeatures ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_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_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - static inline struct LDKOfferId CResult_OfferIdDecodeErrorZ_get_ok(LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR owner){ LDKOfferId ret = *owner->contents.result; ret.is_owned = false; @@ -6307,51 +6647,27 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1OfferBolt12Semantic return ret_conv; } -static inline struct LDKInvoiceRequestWithDerivedPayerIdBuilder CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ - LDKInvoiceRequestWithDerivedPayerIdBuilder ret = *owner->contents.result; +static inline struct LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); - LDKInvoiceRequestWithDerivedPayerIdBuilder ret_var = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder ret_var = CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_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 enum LDKBolt12SemanticError CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ +static inline enum LDKBolt12SemanticError CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return Bolt12SemanticError_clone(&*owner->contents.err); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKBolt12SemanticError_to_java(env, CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline struct LDKInvoiceRequestWithExplicitPayerIdBuilder CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ - LDKInvoiceRequestWithExplicitPayerIdBuilder ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); - LDKInvoiceRequestWithExplicitPayerIdBuilder ret_var = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_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 enum LDKBolt12SemanticError CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return Bolt12SemanticError_clone(&*owner->contents.err); -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKBolt12SemanticError_to_java(env, CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err(owner_conv)); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKBolt12SemanticError_to_java(env, CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(owner_conv)); return ret_conv; } @@ -8054,18 +8370,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1UtxoZNoneZ_1get CResult_CVec_UtxoZNoneZ_get_err(owner_conv); } -static jclass LDKPaymentContext_Unknown_class = NULL; -static jmethodID LDKPaymentContext_Unknown_meth = NULL; static jclass LDKPaymentContext_Bolt12Offer_class = NULL; static jmethodID LDKPaymentContext_Bolt12Offer_meth = NULL; static jclass LDKPaymentContext_Bolt12Refund_class = NULL; static jmethodID LDKPaymentContext_Bolt12Refund_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentContext_init (JNIEnv *env, jclass clz) { - LDKPaymentContext_Unknown_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentContext$Unknown")); - CHECK(LDKPaymentContext_Unknown_class != NULL); - LDKPaymentContext_Unknown_meth = (*env)->GetMethodID(env, LDKPaymentContext_Unknown_class, "", "(J)V"); - CHECK(LDKPaymentContext_Unknown_meth != NULL); LDKPaymentContext_Bolt12Offer_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentContext$Bolt12Offer")); CHECK(LDKPaymentContext_Bolt12Offer_class != NULL); @@ -8080,13 +8389,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentContext_init (J JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentContext_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { LDKPaymentContext *obj = (LDKPaymentContext*)untag_ptr(ptr); switch(obj->tag) { - case LDKPaymentContext_Unknown: { - LDKUnknownPaymentContext unknown_var = obj->unknown; - int64_t unknown_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(unknown_var); - unknown_ref = tag_ptr(unknown_var.inner, false); - return (*env)->NewObject(env, LDKPaymentContext_Unknown_class, LDKPaymentContext_Unknown_meth, unknown_ref); - } case LDKPaymentContext_Bolt12Offer: { LDKBolt12OfferContext bolt12_offer_var = obj->bolt12_offer; int64_t bolt12_offer_ref = 0; @@ -8182,6 +8484,87 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1u64u16 default: abort(); } } +static jclass LDKAPIError_APIMisuseError_class = NULL; +static jmethodID LDKAPIError_APIMisuseError_meth = NULL; +static jclass LDKAPIError_FeeRateTooHigh_class = NULL; +static jmethodID LDKAPIError_FeeRateTooHigh_meth = NULL; +static jclass LDKAPIError_InvalidRoute_class = NULL; +static jmethodID LDKAPIError_InvalidRoute_meth = NULL; +static jclass LDKAPIError_ChannelUnavailable_class = NULL; +static jmethodID LDKAPIError_ChannelUnavailable_meth = NULL; +static jclass LDKAPIError_MonitorUpdateInProgress_class = NULL; +static jmethodID LDKAPIError_MonitorUpdateInProgress_meth = NULL; +static jclass LDKAPIError_IncompatibleShutdownScript_class = NULL; +static jmethodID LDKAPIError_IncompatibleShutdownScript_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv *env, jclass clz) { + LDKAPIError_APIMisuseError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$APIMisuseError")); + CHECK(LDKAPIError_APIMisuseError_class != NULL); + LDKAPIError_APIMisuseError_meth = (*env)->GetMethodID(env, LDKAPIError_APIMisuseError_class, "", "(Ljava/lang/String;)V"); + CHECK(LDKAPIError_APIMisuseError_meth != NULL); + LDKAPIError_FeeRateTooHigh_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$FeeRateTooHigh")); + CHECK(LDKAPIError_FeeRateTooHigh_class != NULL); + LDKAPIError_FeeRateTooHigh_meth = (*env)->GetMethodID(env, LDKAPIError_FeeRateTooHigh_class, "", "(Ljava/lang/String;I)V"); + CHECK(LDKAPIError_FeeRateTooHigh_meth != NULL); + LDKAPIError_InvalidRoute_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$InvalidRoute")); + CHECK(LDKAPIError_InvalidRoute_class != NULL); + LDKAPIError_InvalidRoute_meth = (*env)->GetMethodID(env, LDKAPIError_InvalidRoute_class, "", "(Ljava/lang/String;)V"); + CHECK(LDKAPIError_InvalidRoute_meth != NULL); + LDKAPIError_ChannelUnavailable_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$ChannelUnavailable")); + CHECK(LDKAPIError_ChannelUnavailable_class != NULL); + LDKAPIError_ChannelUnavailable_meth = (*env)->GetMethodID(env, LDKAPIError_ChannelUnavailable_class, "", "(Ljava/lang/String;)V"); + CHECK(LDKAPIError_ChannelUnavailable_meth != NULL); + LDKAPIError_MonitorUpdateInProgress_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$MonitorUpdateInProgress")); + CHECK(LDKAPIError_MonitorUpdateInProgress_class != NULL); + LDKAPIError_MonitorUpdateInProgress_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateInProgress_class, "", "()V"); + CHECK(LDKAPIError_MonitorUpdateInProgress_meth != NULL); + LDKAPIError_IncompatibleShutdownScript_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$IncompatibleShutdownScript")); + CHECK(LDKAPIError_IncompatibleShutdownScript_class != NULL); + LDKAPIError_IncompatibleShutdownScript_meth = (*env)->GetMethodID(env, LDKAPIError_IncompatibleShutdownScript_class, "", "(J)V"); + CHECK(LDKAPIError_IncompatibleShutdownScript_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKAPIError_APIMisuseError: { + LDKStr err_str = obj->api_misuse_error.err; + jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); + return (*env)->NewObject(env, LDKAPIError_APIMisuseError_class, LDKAPIError_APIMisuseError_meth, err_conv); + } + case LDKAPIError_FeeRateTooHigh: { + LDKStr err_str = obj->fee_rate_too_high.err; + jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); + int32_t feerate_conv = obj->fee_rate_too_high.feerate; + return (*env)->NewObject(env, LDKAPIError_FeeRateTooHigh_class, LDKAPIError_FeeRateTooHigh_meth, err_conv, feerate_conv); + } + case LDKAPIError_InvalidRoute: { + LDKStr err_str = obj->invalid_route.err; + jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); + return (*env)->NewObject(env, LDKAPIError_InvalidRoute_class, LDKAPIError_InvalidRoute_meth, err_conv); + } + case LDKAPIError_ChannelUnavailable: { + LDKStr err_str = obj->channel_unavailable.err; + jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); + return (*env)->NewObject(env, LDKAPIError_ChannelUnavailable_class, LDKAPIError_ChannelUnavailable_meth, err_conv); + } + case LDKAPIError_MonitorUpdateInProgress: { + return (*env)->NewObject(env, LDKAPIError_MonitorUpdateInProgress_class, LDKAPIError_MonitorUpdateInProgress_meth); + } + case LDKAPIError_IncompatibleShutdownScript: { + LDKShutdownScript script_var = obj->incompatible_shutdown_script.script; + int64_t script_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var); + script_ref = tag_ptr(script_var.inner, false); + return (*env)->NewObject(env, LDKAPIError_IncompatibleShutdownScript_class, LDKAPIError_IncompatibleShutdownScript_meth, script_ref); + } + default: abort(); + } +} static inline struct LDKChannelId CResult_ChannelIdAPIErrorZ_get_ok(LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR owner){ LDKChannelId ret = *owner->contents.result; ret.is_owned = false; @@ -8277,119 +8660,23 @@ static inline LDKCVec_RecentPaymentDetailsZ CVec_RecentPaymentDetailsZ_clone(con } return ret; } -static jclass LDKPaymentSendFailure_ParameterError_class = NULL; -static jmethodID LDKPaymentSendFailure_ParameterError_meth = NULL; -static jclass LDKPaymentSendFailure_PathParameterError_class = NULL; -static jmethodID LDKPaymentSendFailure_PathParameterError_meth = NULL; -static jclass LDKPaymentSendFailure_AllFailedResendSafe_class = NULL; -static jmethodID LDKPaymentSendFailure_AllFailedResendSafe_meth = NULL; -static jclass LDKPaymentSendFailure_DuplicatePayment_class = NULL; -static jmethodID LDKPaymentSendFailure_DuplicatePayment_meth = NULL; -static jclass LDKPaymentSendFailure_PartialFailure_class = NULL; -static jmethodID LDKPaymentSendFailure_PartialFailure_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentSendFailure_init (JNIEnv *env, jclass clz) { - LDKPaymentSendFailure_ParameterError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$ParameterError")); - CHECK(LDKPaymentSendFailure_ParameterError_class != NULL); - LDKPaymentSendFailure_ParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_ParameterError_class, "", "(J)V"); - CHECK(LDKPaymentSendFailure_ParameterError_meth != NULL); - LDKPaymentSendFailure_PathParameterError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$PathParameterError")); - CHECK(LDKPaymentSendFailure_PathParameterError_class != NULL); - LDKPaymentSendFailure_PathParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PathParameterError_class, "", "([J)V"); - CHECK(LDKPaymentSendFailure_PathParameterError_meth != NULL); - LDKPaymentSendFailure_AllFailedResendSafe_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$AllFailedResendSafe")); - CHECK(LDKPaymentSendFailure_AllFailedResendSafe_class != NULL); - LDKPaymentSendFailure_AllFailedResendSafe_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_AllFailedResendSafe_class, "", "([J)V"); - CHECK(LDKPaymentSendFailure_AllFailedResendSafe_meth != NULL); - LDKPaymentSendFailure_DuplicatePayment_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$DuplicatePayment")); - CHECK(LDKPaymentSendFailure_DuplicatePayment_class != NULL); - LDKPaymentSendFailure_DuplicatePayment_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_DuplicatePayment_class, "", "()V"); - CHECK(LDKPaymentSendFailure_DuplicatePayment_meth != NULL); - LDKPaymentSendFailure_PartialFailure_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$PartialFailure")); - CHECK(LDKPaymentSendFailure_PartialFailure_class != NULL); - LDKPaymentSendFailure_PartialFailure_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PartialFailure_class, "", "([JJ[B)V"); - CHECK(LDKPaymentSendFailure_PartialFailure_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr); - switch(obj->tag) { - case LDKPaymentSendFailure_ParameterError: { - int64_t parameter_error_ref = tag_ptr(&obj->parameter_error, false); - return (*env)->NewObject(env, LDKPaymentSendFailure_ParameterError_class, LDKPaymentSendFailure_ParameterError_meth, parameter_error_ref); - } - case LDKPaymentSendFailure_PathParameterError: { - LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error; - int64_tArray path_parameter_error_arr = NULL; - path_parameter_error_arr = (*env)->NewLongArray(env, path_parameter_error_var.datalen); - int64_t *path_parameter_error_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_parameter_error_arr, NULL); - for (size_t w = 0; w < path_parameter_error_var.datalen; w++) { - LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *path_parameter_error_conv_22_conv = path_parameter_error_var.data[w]; - *path_parameter_error_conv_22_conv = CResult_NoneAPIErrorZ_clone(path_parameter_error_conv_22_conv); - path_parameter_error_arr_ptr[w] = tag_ptr(path_parameter_error_conv_22_conv, true); - } - (*env)->ReleasePrimitiveArrayCritical(env, path_parameter_error_arr, path_parameter_error_arr_ptr, 0); - return (*env)->NewObject(env, LDKPaymentSendFailure_PathParameterError_class, LDKPaymentSendFailure_PathParameterError_meth, path_parameter_error_arr); - } - case LDKPaymentSendFailure_AllFailedResendSafe: { - LDKCVec_APIErrorZ all_failed_resend_safe_var = obj->all_failed_resend_safe; - int64_tArray all_failed_resend_safe_arr = NULL; - all_failed_resend_safe_arr = (*env)->NewLongArray(env, all_failed_resend_safe_var.datalen); - int64_t *all_failed_resend_safe_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, all_failed_resend_safe_arr, NULL); - for (size_t k = 0; k < all_failed_resend_safe_var.datalen; k++) { - int64_t all_failed_resend_safe_conv_10_ref = tag_ptr(&all_failed_resend_safe_var.data[k], false); - all_failed_resend_safe_arr_ptr[k] = all_failed_resend_safe_conv_10_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, all_failed_resend_safe_arr, all_failed_resend_safe_arr_ptr, 0); - return (*env)->NewObject(env, LDKPaymentSendFailure_AllFailedResendSafe_class, LDKPaymentSendFailure_AllFailedResendSafe_meth, all_failed_resend_safe_arr); - } - case LDKPaymentSendFailure_DuplicatePayment: { - return (*env)->NewObject(env, LDKPaymentSendFailure_DuplicatePayment_class, LDKPaymentSendFailure_DuplicatePayment_meth); - } - case LDKPaymentSendFailure_PartialFailure: { - LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results; - int64_tArray results_arr = NULL; - results_arr = (*env)->NewLongArray(env, results_var.datalen); - int64_t *results_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, results_arr, NULL); - for (size_t w = 0; w < results_var.datalen; w++) { - LDKCResult_NoneAPIErrorZ* results_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *results_conv_22_conv = results_var.data[w]; - *results_conv_22_conv = CResult_NoneAPIErrorZ_clone(results_conv_22_conv); - results_arr_ptr[w] = tag_ptr(results_conv_22_conv, true); - } - (*env)->ReleasePrimitiveArrayCritical(env, results_arr, results_arr_ptr, 0); - LDKRouteParameters failed_paths_retry_var = obj->partial_failure.failed_paths_retry; - int64_t failed_paths_retry_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var); - failed_paths_retry_ref = tag_ptr(failed_paths_retry_var.inner, false); - int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->partial_failure.payment_id.data); - return (*env)->NewObject(env, LDKPaymentSendFailure_PartialFailure_class, LDKPaymentSendFailure_PartialFailure_meth, results_arr, failed_paths_retry_ref, payment_id_arr); - } - default: abort(); - } -} -static inline void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){ +static inline void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return *owner->contents.result; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner); - CResult_NonePaymentSendFailureZ_get_ok(owner_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner); + CResult_NoneAPIErrorZ_get_ok(owner_conv); } -static inline struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){ +static inline struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return PaymentSendFailure_clone(&*owner->contents.err); + return APIError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = CResult_NoneAPIErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -8413,25 +8700,101 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFa return ret_conv; } -static inline struct LDKThirtyTwoBytes CResult_ThirtyTwoBytesPaymentSendFailureZ_get_ok(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR owner){ +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 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(); + } +} +static inline void CResult_NoneBolt12PaymentErrorZ_get_ok(LDKCResult_NoneBolt12PaymentErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return ThirtyTwoBytes_clone(&*owner->contents.result); + return *owner->contents.result; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* owner_conv = (LDKCResult_ThirtyTwoBytesPaymentSendFailureZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_ThirtyTwoBytesPaymentSendFailureZ_get_ok(owner_conv).data); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneBolt12PaymentErrorZ* owner_conv = (LDKCResult_NoneBolt12PaymentErrorZ*)untag_ptr(owner); + CResult_NoneBolt12PaymentErrorZ_get_ok(owner_conv); } -static inline struct LDKPaymentSendFailure CResult_ThirtyTwoBytesPaymentSendFailureZ_get_err(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR owner){ +static inline struct LDKBolt12PaymentError CResult_NoneBolt12PaymentErrorZ_get_err(LDKCResult_NoneBolt12PaymentErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return PaymentSendFailure_clone(&*owner->contents.err); + return Bolt12PaymentError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* owner_conv = (LDKCResult_ThirtyTwoBytesPaymentSendFailureZ*)untag_ptr(owner); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = CResult_ThirtyTwoBytesPaymentSendFailureZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneBolt12PaymentErrorZ* owner_conv = (LDKCResult_NoneBolt12PaymentErrorZ*)untag_ptr(owner); + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = CResult_NoneBolt12PaymentErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -8477,25 +8840,64 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ThirtyTwoBytes return ret_arr; } -static inline struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_get_ok(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR owner){ +static jclass LDKProbeSendFailure_RouteNotFound_class = NULL; +static jmethodID LDKProbeSendFailure_RouteNotFound_meth = NULL; +static jclass LDKProbeSendFailure_ParameterError_class = NULL; +static jmethodID LDKProbeSendFailure_ParameterError_meth = NULL; +static jclass LDKProbeSendFailure_DuplicateProbe_class = NULL; +static jmethodID LDKProbeSendFailure_DuplicateProbe_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKProbeSendFailure_init (JNIEnv *env, jclass clz) { + LDKProbeSendFailure_RouteNotFound_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKProbeSendFailure$RouteNotFound")); + CHECK(LDKProbeSendFailure_RouteNotFound_class != NULL); + LDKProbeSendFailure_RouteNotFound_meth = (*env)->GetMethodID(env, LDKProbeSendFailure_RouteNotFound_class, "", "()V"); + CHECK(LDKProbeSendFailure_RouteNotFound_meth != NULL); + LDKProbeSendFailure_ParameterError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKProbeSendFailure$ParameterError")); + CHECK(LDKProbeSendFailure_ParameterError_class != NULL); + LDKProbeSendFailure_ParameterError_meth = (*env)->GetMethodID(env, LDKProbeSendFailure_ParameterError_class, "", "(J)V"); + CHECK(LDKProbeSendFailure_ParameterError_meth != NULL); + LDKProbeSendFailure_DuplicateProbe_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKProbeSendFailure$DuplicateProbe")); + CHECK(LDKProbeSendFailure_DuplicateProbe_class != NULL); + LDKProbeSendFailure_DuplicateProbe_meth = (*env)->GetMethodID(env, LDKProbeSendFailure_DuplicateProbe_class, "", "()V"); + CHECK(LDKProbeSendFailure_DuplicateProbe_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKProbeSendFailure_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKProbeSendFailure *obj = (LDKProbeSendFailure*)untag_ptr(ptr); + switch(obj->tag) { + case LDKProbeSendFailure_RouteNotFound: { + return (*env)->NewObject(env, LDKProbeSendFailure_RouteNotFound_class, LDKProbeSendFailure_RouteNotFound_meth); + } + case LDKProbeSendFailure_ParameterError: { + int64_t parameter_error_ref = tag_ptr(&obj->parameter_error, false); + return (*env)->NewObject(env, LDKProbeSendFailure_ParameterError_class, LDKProbeSendFailure_ParameterError_meth, parameter_error_ref); + } + case LDKProbeSendFailure_DuplicateProbe: { + return (*env)->NewObject(env, LDKProbeSendFailure_DuplicateProbe_class, LDKProbeSendFailure_DuplicateProbe_meth); + } + default: abort(); + } +} +static inline struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_get_ok(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone(&*owner->contents.result); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* owner_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ*)untag_ptr(owner); LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ), "LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ"); - *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_get_ok(owner_conv); + *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_get_ok(owner_conv); return tag_ptr(ret_conv, true); } -static inline struct LDKPaymentSendFailure CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_get_err(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR owner){ +static inline struct LDKProbeSendFailure CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_get_err(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return PaymentSendFailure_clone(&*owner->contents.err); + return ProbeSendFailure_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ*)untag_ptr(owner); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* owner_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ*)untag_ptr(owner); + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -8507,35 +8909,6 @@ static inline LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ CVec_C2Tuple_Thirty } return ret; } -static jclass LDKProbeSendFailure_RouteNotFound_class = NULL; -static jmethodID LDKProbeSendFailure_RouteNotFound_meth = NULL; -static jclass LDKProbeSendFailure_SendingFailed_class = NULL; -static jmethodID LDKProbeSendFailure_SendingFailed_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKProbeSendFailure_init (JNIEnv *env, jclass clz) { - LDKProbeSendFailure_RouteNotFound_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKProbeSendFailure$RouteNotFound")); - CHECK(LDKProbeSendFailure_RouteNotFound_class != NULL); - LDKProbeSendFailure_RouteNotFound_meth = (*env)->GetMethodID(env, LDKProbeSendFailure_RouteNotFound_class, "", "()V"); - CHECK(LDKProbeSendFailure_RouteNotFound_meth != NULL); - LDKProbeSendFailure_SendingFailed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKProbeSendFailure$SendingFailed")); - CHECK(LDKProbeSendFailure_SendingFailed_class != NULL); - LDKProbeSendFailure_SendingFailed_meth = (*env)->GetMethodID(env, LDKProbeSendFailure_SendingFailed_class, "", "(J)V"); - CHECK(LDKProbeSendFailure_SendingFailed_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKProbeSendFailure_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKProbeSendFailure *obj = (LDKProbeSendFailure*)untag_ptr(ptr); - switch(obj->tag) { - case LDKProbeSendFailure_RouteNotFound: { - return (*env)->NewObject(env, LDKProbeSendFailure_RouteNotFound_class, LDKProbeSendFailure_RouteNotFound_meth); - } - case LDKProbeSendFailure_SendingFailed: { - int64_t sending_failed_ref = tag_ptr(&obj->sending_failed, false); - return (*env)->NewObject(env, LDKProbeSendFailure_SendingFailed_class, LDKProbeSendFailure_SendingFailed_meth, sending_failed_ref); - } - default: abort(); - } -} static inline struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_get_ok(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ_clone(&*owner->contents.result); @@ -8606,6 +8979,116 @@ static inline LDKCVec_ChannelIdZ CVec_ChannelIdZ_clone(const LDKCVec_ChannelIdZ } return ret; } +static inline struct LDKPublicKey C2Tuple_PublicKeyChannelIdZ_get_a(LDKC2Tuple_PublicKeyChannelIdZ *NONNULL_PTR owner){ + return owner->a; +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyChannelIdZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_PublicKeyChannelIdZ* owner_conv = (LDKC2Tuple_PublicKeyChannelIdZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, C2Tuple_PublicKeyChannelIdZ_get_a(owner_conv).compressed_form); + return ret_arr; +} + +static inline struct LDKChannelId C2Tuple_PublicKeyChannelIdZ_get_b(LDKC2Tuple_PublicKeyChannelIdZ *NONNULL_PTR owner){ + LDKChannelId ret = owner->b; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyChannelIdZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_PublicKeyChannelIdZ* owner_conv = (LDKC2Tuple_PublicKeyChannelIdZ*)untag_ptr(owner); + LDKChannelId ret_var = C2Tuple_PublicKeyChannelIdZ_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_PublicKeyChannelIdZZ_Some_class = NULL; +static jmethodID LDKCOption_C2Tuple_PublicKeyChannelIdZZ_Some_meth = NULL; +static jclass LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None_class = NULL; +static jmethodID LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1PublicKeyChannelIdZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_PublicKeyChannelIdZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_PublicKeyChannelIdZZ$Some")); + CHECK(LDKCOption_C2Tuple_PublicKeyChannelIdZZ_Some_class != NULL); + LDKCOption_C2Tuple_PublicKeyChannelIdZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_PublicKeyChannelIdZZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_C2Tuple_PublicKeyChannelIdZZ_Some_meth != NULL); + LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_PublicKeyChannelIdZZ$None")); + CHECK(LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None_class != NULL); + LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None_class, "", "()V"); + CHECK(LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1PublicKeyChannelIdZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_C2Tuple_PublicKeyChannelIdZZ *obj = (LDKCOption_C2Tuple_PublicKeyChannelIdZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_C2Tuple_PublicKeyChannelIdZZ_Some: { + LDKC2Tuple_PublicKeyChannelIdZ* some_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyChannelIdZ), "LDKC2Tuple_PublicKeyChannelIdZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_PublicKeyChannelIdZ_clone(some_conv); + return (*env)->NewObject(env, LDKCOption_C2Tuple_PublicKeyChannelIdZZ_Some_class, LDKCOption_C2Tuple_PublicKeyChannelIdZZ_Some_meth, tag_ptr(some_conv, true)); + } + case LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None: { + return (*env)->NewObject(env, LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None_class, LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None_meth); + } + default: abort(); + } +} +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 inline struct LDKOfferWithDerivedMetadataBuilder CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ LDKOfferWithDerivedMetadataBuilder ret = *owner->contents.result; ret.is_owned = false; @@ -8660,6 +9143,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1StrZ_1ref_1from default: abort(); } } +static inline LDKCVec_DestinationZ CVec_DestinationZ_clone(const LDKCVec_DestinationZ *orig) { + LDKCVec_DestinationZ ret = { .data = MALLOC(sizeof(LDKDestination) * orig->datalen, "LDKCVec_DestinationZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = Destination_clone(&orig->data[i]); + } + return ret; +} static inline struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_get_ok(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone(&*owner->contents.result); @@ -8703,87 +9193,6 @@ 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; @@ -8890,132 +9299,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1Offers default: abort(); } } -static jclass LDKDestination_Node_class = NULL; -static jmethodID LDKDestination_Node_meth = NULL; -static jclass LDKDestination_BlindedPath_class = NULL; -static jmethodID LDKDestination_BlindedPath_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDestination_init (JNIEnv *env, jclass clz) { - LDKDestination_Node_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$Node")); - CHECK(LDKDestination_Node_class != NULL); - LDKDestination_Node_meth = (*env)->GetMethodID(env, LDKDestination_Node_class, "", "([B)V"); - CHECK(LDKDestination_Node_meth != NULL); - LDKDestination_BlindedPath_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$BlindedPath")); - CHECK(LDKDestination_BlindedPath_class != NULL); - LDKDestination_BlindedPath_meth = (*env)->GetMethodID(env, LDKDestination_BlindedPath_class, "", "(J)V"); - CHECK(LDKDestination_BlindedPath_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKDestination *obj = (LDKDestination*)untag_ptr(ptr); - switch(obj->tag) { - case LDKDestination_Node: { - int8_tArray node_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, node_arr, 0, 33, obj->node.compressed_form); - return (*env)->NewObject(env, LDKDestination_Node_class, LDKDestination_Node_meth, node_arr); - } - case LDKDestination_BlindedPath: { - 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); - return (*env)->NewObject(env, LDKDestination_BlindedPath_class, LDKDestination_BlindedPath_meth, blinded_path_ref); - } - default: abort(); - } -} -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); } @@ -9241,7 +9524,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPendingHTLCRouting_ini LDKPendingHTLCRouting_ReceiveKeysend_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPendingHTLCRouting$ReceiveKeysend")); CHECK(LDKPendingHTLCRouting_ReceiveKeysend_class != NULL); - LDKPendingHTLCRouting_ReceiveKeysend_meth = (*env)->GetMethodID(env, LDKPendingHTLCRouting_ReceiveKeysend_class, "", "(J[BJI[JZ)V"); + LDKPendingHTLCRouting_ReceiveKeysend_meth = (*env)->GetMethodID(env, LDKPendingHTLCRouting_ReceiveKeysend_class, "", "(J[BJI[JZZ)V"); CHECK(LDKPendingHTLCRouting_ReceiveKeysend_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPendingHTLCRouting_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { @@ -9304,7 +9587,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPendingHTLCRouting_1ref_ } (*env)->ReleasePrimitiveArrayCritical(env, custom_tlvs_arr, custom_tlvs_arr_ptr, 0); jboolean requires_blinded_error_conv = obj->receive_keysend.requires_blinded_error; - return (*env)->NewObject(env, LDKPendingHTLCRouting_ReceiveKeysend_class, LDKPendingHTLCRouting_ReceiveKeysend_meth, payment_data_ref, payment_preimage_arr, payment_metadata_ref, incoming_cltv_expiry_conv, custom_tlvs_arr, requires_blinded_error_conv); + jboolean has_recipient_created_payment_secret_conv = obj->receive_keysend.has_recipient_created_payment_secret; + return (*env)->NewObject(env, LDKPendingHTLCRouting_ReceiveKeysend_class, LDKPendingHTLCRouting_ReceiveKeysend_meth, payment_data_ref, payment_preimage_arr, payment_metadata_ref, incoming_cltv_expiry_conv, custom_tlvs_arr, requires_blinded_error_conv, has_recipient_created_payment_secret_conv); } default: abort(); } @@ -9841,11 +10125,10 @@ typedef struct LDKNodeSigner_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; - jmethodID get_inbound_payment_key_material_meth; + jmethodID get_inbound_payment_key_meth; jmethodID get_node_id_meth; jmethodID ecdh_meth; jmethodID sign_invoice_meth; - jmethodID sign_bolt12_invoice_request_meth; jmethodID sign_bolt12_invoice_meth; jmethodID sign_gossip_message_meth; } LDKNodeSigner_JCalls; @@ -9866,7 +10149,7 @@ static void LDKNodeSigner_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKThirtyTwoBytes get_inbound_payment_key_material_LDKNodeSigner_jcall(const void* this_arg) { +LDKExpandedKey get_inbound_payment_key_LDKNodeSigner_jcall(const void* this_arg) { 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); @@ -9877,18 +10160,19 @@ LDKThirtyTwoBytes get_inbound_payment_key_material_LDKNodeSigner_jcall(const voi } jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_inbound_payment_key_material_meth); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_inbound_payment_key_meth); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to get_inbound_payment_key_material in LDKNodeSigner from rust threw an exception."); + (*env)->FatalError(env, "A call to get_inbound_payment_key in LDKNodeSigner from rust threw an exception."); } - LDKThirtyTwoBytes ret_ref; - CHECK((*env)->GetArrayLength(env, ret) == 32); - (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data); + LDKExpandedKey ret_conv; + ret_conv.inner = untag_ptr(ret); + ret_conv.is_owned = ptr_is_owned(ret); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } - return ret_ref; + return ret_conv; } LDKCResult_PublicKeyNoneZ get_node_id_LDKNodeSigner_jcall(const void* this_arg, LDKRecipient recipient) { LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; @@ -9978,36 +10262,6 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKNodeSigner_jcall(const void } return ret_conv; } -LDKCResult_SchnorrSignatureNoneZ sign_bolt12_invoice_request_LDKNodeSigner_jcall(const void* this_arg, const LDKUnsignedInvoiceRequest * invoice_request) { - 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); - 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); - } - LDKUnsignedInvoiceRequest invoice_request_var = *invoice_request; - int64_t invoice_request_ref = 0; - invoice_request_var = UnsignedInvoiceRequest_clone(&invoice_request_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_request_var); - invoice_request_ref = tag_ptr(invoice_request_var.inner, invoice_request_var.is_owned); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_bolt12_invoice_request_meth, invoice_request_ref); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to sign_bolt12_invoice_request in LDKNodeSigner from rust threw an exception."); - } - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_SchnorrSignatureNoneZ ret_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(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_SchnorrSignatureNoneZ sign_bolt12_invoice_LDKNodeSigner_jcall(const void* this_arg, const LDKUnsignedBolt12Invoice * invoice) { LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; JNIEnv *env; @@ -10077,16 +10331,14 @@ static inline LDKNodeSigner LDKNodeSigner_init (JNIEnv *env, jclass clz, jobject atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->get_inbound_payment_key_material_meth = (*env)->GetMethodID(env, c, "get_inbound_payment_key_material", "()[B"); - CHECK(calls->get_inbound_payment_key_material_meth != NULL); + calls->get_inbound_payment_key_meth = (*env)->GetMethodID(env, c, "get_inbound_payment_key", "()J"); + CHECK(calls->get_inbound_payment_key_meth != NULL); calls->get_node_id_meth = (*env)->GetMethodID(env, c, "get_node_id", "(Lorg/ldk/enums/Recipient;)J"); 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", "(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); calls->sign_bolt12_invoice_meth = (*env)->GetMethodID(env, c, "sign_bolt12_invoice", "(J)J"); CHECK(calls->sign_bolt12_invoice_meth != NULL); calls->sign_gossip_message_meth = (*env)->GetMethodID(env, c, "sign_gossip_message", "(J)J"); @@ -10094,11 +10346,10 @@ static inline LDKNodeSigner LDKNodeSigner_init (JNIEnv *env, jclass clz, jobject LDKNodeSigner ret = { .this_arg = (void*) calls, - .get_inbound_payment_key_material = get_inbound_payment_key_material_LDKNodeSigner_jcall, + .get_inbound_payment_key = get_inbound_payment_key_LDKNodeSigner_jcall, .get_node_id = get_node_id_LDKNodeSigner_jcall, .ecdh = ecdh_LDKNodeSigner_jcall, .sign_invoice = sign_invoice_LDKNodeSigner_jcall, - .sign_bolt12_invoice_request = sign_bolt12_invoice_request_LDKNodeSigner_jcall, .sign_bolt12_invoice = sign_bolt12_invoice_LDKNodeSigner_jcall, .sign_gossip_message = sign_gossip_message_LDKNodeSigner_jcall, .free = LDKNodeSigner_JCalls_free, @@ -10110,13 +10361,15 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKNodeSigner_1new(JNIEnv * *res_ptr = LDKNodeSigner_init(env, clz, o); return tag_ptr(res_ptr, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeSigner_1get_1inbound_1payment_1key_1material(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1get_1inbound_1payment_1key(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); } LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data); - return ret_arr; + LDKExpandedKey ret_var = (this_arg_conv->get_inbound_payment_key)(this_arg_conv->this_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg, jclass recipient) { @@ -10161,20 +10414,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1sign_1invoice(J return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1sign_1bolt12_1invoice_1request(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice_request) { - 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; - LDKUnsignedInvoiceRequest invoice_request_conv; - invoice_request_conv.inner = untag_ptr(invoice_request); - invoice_request_conv.is_owned = ptr_is_owned(invoice_request); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_request_conv); - invoice_request_conv.is_owned = false; - LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); - *ret_conv = (this_arg_conv->sign_bolt12_invoice_request)(this_arg_conv->this_arg, &invoice_request_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1sign_1bolt12_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -10541,6 +10780,403 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1get_1est_1sat return ret_conv; } +typedef struct LDKRouter_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID find_route_meth; + jmethodID find_route_with_id_meth; + jmethodID create_blinded_payment_paths_meth; +} LDKRouter_JCalls; +static void LDKRouter_JCalls_free(void* this_arg) { + LDKRouter_JCalls *j_calls = (LDKRouter_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); + } +} +LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, LDKCVec_ChannelDetailsZ * first_hops, LDKInFlightHtlcs inflight_htlcs) { + 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); + 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 payer_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, payer_arr, 0, 33, payer.compressed_form); + LDKRouteParameters route_params_var = *route_params; + int64_t route_params_ref = 0; + route_params_var = RouteParameters_clone(&route_params_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var); + route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned); + LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops; + int64_tArray first_hops_arr = NULL; + if (first_hops != NULL) { + LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr; + first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen); + int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL); + for (size_t q = 0; q < first_hops_var.datalen; q++) { + LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q]; + int64_t first_hops_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); + first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned); + first_hops_arr_ptr[q] = first_hops_conv_16_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0); + } + LDKInFlightHtlcs inflight_htlcs_var = inflight_htlcs; + int64_t inflight_htlcs_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var); + inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_meth, payer_arr, route_params_ref, first_hops_arr, inflight_htlcs_ref); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to find_route in LDKRouter from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(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_RouteLightningErrorZ find_route_with_id_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, LDKCVec_ChannelDetailsZ * first_hops, LDKInFlightHtlcs inflight_htlcs, LDKThirtyTwoBytes _payment_hash, LDKThirtyTwoBytes _payment_id) { + 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); + 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 payer_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, payer_arr, 0, 33, payer.compressed_form); + LDKRouteParameters route_params_var = *route_params; + int64_t route_params_ref = 0; + route_params_var = RouteParameters_clone(&route_params_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var); + route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned); + LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops; + int64_tArray first_hops_arr = NULL; + if (first_hops != NULL) { + LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr; + first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen); + int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL); + for (size_t q = 0; q < first_hops_var.datalen; q++) { + LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q]; + int64_t first_hops_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); + first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned); + first_hops_arr_ptr[q] = first_hops_conv_16_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0); + } + LDKInFlightHtlcs inflight_htlcs_var = inflight_htlcs; + int64_t inflight_htlcs_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var); + inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned); + int8_tArray _payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, _payment_hash_arr, 0, 32, _payment_hash.data); + int8_tArray _payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, _payment_id_arr, 0, 32, _payment_id.data); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_with_id_meth, payer_arr, route_params_ref, first_hops_arr, inflight_htlcs_ref, _payment_hash_arr, _payment_id_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to find_route_with_id in LDKRouter from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(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_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); + 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); + LDKCVec_ChannelDetailsZ first_hops_var = first_hops; + int64_tArray first_hops_arr = NULL; + first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen); + int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL); + for (size_t q = 0; q < first_hops_var.datalen; q++) { + LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q]; + int64_t first_hops_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); + first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned); + first_hops_arr_ptr[q] = first_hops_conv_16_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0); + FREE(first_hops_var.data); + LDKReceiveTlvs tlvs_var = tlvs; + int64_t tlvs_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_var); + tlvs_ref = tag_ptr(tlvs_var.inner, tlvs_var.is_owned); + int64_t amount_msats_conv = amount_msats; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->create_blinded_payment_paths_meth, recipient_arr, first_hops_arr, tlvs_ref, amount_msats_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to create_blinded_payment_paths in LDKRouter from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(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); + } + return ret_conv; +} +static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) { + LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKRouter LDKRouter_init (JNIEnv *env, jclass clz, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->find_route_meth = (*env)->GetMethodID(env, c, "find_route", "([BJ[JJ)J"); + CHECK(calls->find_route_meth != NULL); + calls->find_route_with_id_meth = (*env)->GetMethodID(env, c, "find_route_with_id", "([BJ[JJ[B[B)J"); + CHECK(calls->find_route_with_id_meth != NULL); + calls->create_blinded_payment_paths_meth = (*env)->GetMethodID(env, c, "create_blinded_payment_paths", "([B[JJJ)J"); + CHECK(calls->create_blinded_payment_paths_meth != NULL); + + LDKRouter ret = { + .this_arg = (void*) calls, + .find_route = find_route_LDKRouter_jcall, + .find_route_with_id = find_route_with_id_LDKRouter_jcall, + .create_blinded_payment_paths = create_blinded_payment_paths_LDKRouter_jcall, + .free = LDKRouter_JCalls_free, + }; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRouter_1new(JNIEnv *env, jclass clz, jobject o) { + LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter"); + *res_ptr = LDKRouter_init(env, clz, o); + return tag_ptr(res_ptr, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t route_params, int64_tArray first_hops, int64_t inflight_htlcs) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr; + LDKPublicKey payer_ref; + CHECK((*env)->GetArrayLength(env, payer) == 33); + (*env)->GetByteArrayRegion(env, payer, 0, 33, payer_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; + 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; + } + 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 = InFlightHtlcs_clone(&inflight_htlcs_conv); + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, &route_params_conv, first_hops_ptr, inflight_htlcs_conv); + if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route_1with_1id(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t route_params, int64_tArray first_hops, int64_t inflight_htlcs, int8_tArray _payment_hash, int8_tArray _payment_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr; + LDKPublicKey payer_ref; + CHECK((*env)->GetArrayLength(env, payer) == 33); + (*env)->GetByteArrayRegion(env, payer, 0, 33, payer_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; + 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; + } + 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 = InFlightHtlcs_clone(&inflight_htlcs_conv); + LDKThirtyTwoBytes _payment_hash_ref; + CHECK((*env)->GetArrayLength(env, _payment_hash) == 32); + (*env)->GetByteArrayRegion(env, _payment_hash, 0, 32, _payment_hash_ref.data); + LDKThirtyTwoBytes _payment_id_ref; + CHECK((*env)->GetArrayLength(env, _payment_id) == 32); + (*env)->GetByteArrayRegion(env, _payment_id, 0, 32, _payment_id_ref.data); + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = (this_arg_conv->find_route_with_id)(this_arg_conv->this_arg, payer_ref, &route_params_conv, first_hops_ptr, inflight_htlcs_conv, _payment_hash_ref, _payment_id_ref); + if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1create_1blinded_1payment_1paths(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray recipient, int64_tArray first_hops, int64_t tlvs, int64_t amount_msats) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr; + LDKPublicKey recipient_ref; + CHECK((*env)->GetArrayLength(env, recipient) == 33); + (*env)->GetByteArrayRegion(env, recipient, 0, 33, recipient_ref.compressed_form); + LDKCVec_ChannelDetailsZ first_hops_constr; + 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 = ChannelDetails_clone(&first_hops_conv_16_conv); + first_hops_constr.data[q] = first_hops_conv_16_conv; + } + (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0); + LDKReceiveTlvs tlvs_conv; + tlvs_conv.inner = untag_ptr(tlvs); + tlvs_conv.is_owned = ptr_is_owned(tlvs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_conv); + tlvs_conv = ReceiveTlvs_clone(&tlvs_conv); + 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); +} + +static inline struct LDKOnionMessagePath CResult_OnionMessagePathNoneZ_get_ok(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner){ + LDKOnionMessagePath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_OnionMessagePathNoneZ* owner_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(owner); + LDKOnionMessagePath ret_var = CResult_OnionMessagePathNoneZ_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_OnionMessagePathNoneZ_get_err(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_OnionMessagePathNoneZ* owner_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(owner); + CResult_OnionMessagePathNoneZ_get_err(owner_conv); +} + +static inline struct LDKCVec_BlindedMessagePathZ CResult_CVec_BlindedMessagePathZNoneZ_get_ok(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return CVec_BlindedMessagePathZ_clone(&*owner->contents.result); +} +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 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_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_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; +} typedef struct LDKMessageRouter_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -10814,350 +11450,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageRouter_1create_1comp return tag_ptr(ret_conv, true); } -typedef struct LDKRouter_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - LDKMessageRouter_JCalls* MessageRouter; - jmethodID find_route_meth; - jmethodID find_route_with_id_meth; - jmethodID create_blinded_payment_paths_meth; -} LDKRouter_JCalls; -static void LDKRouter_JCalls_free(void* this_arg) { - LDKRouter_JCalls *j_calls = (LDKRouter_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); - } -} -LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, LDKCVec_ChannelDetailsZ * first_hops, LDKInFlightHtlcs inflight_htlcs) { - 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); - 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 payer_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, payer_arr, 0, 33, payer.compressed_form); - LDKRouteParameters route_params_var = *route_params; - int64_t route_params_ref = 0; - route_params_var = RouteParameters_clone(&route_params_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var); - route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned); - LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops; - int64_tArray first_hops_arr = NULL; - if (first_hops != NULL) { - LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr; - first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen); - int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL); - for (size_t q = 0; q < first_hops_var.datalen; q++) { - LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q]; - int64_t first_hops_conv_16_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); - first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned); - first_hops_arr_ptr[q] = first_hops_conv_16_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0); - } - LDKInFlightHtlcs inflight_htlcs_var = inflight_htlcs; - int64_t inflight_htlcs_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var); - inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_meth, payer_arr, route_params_ref, first_hops_arr, inflight_htlcs_ref); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to find_route in LDKRouter from rust threw an exception."); - } - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(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_RouteLightningErrorZ find_route_with_id_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, LDKCVec_ChannelDetailsZ * first_hops, LDKInFlightHtlcs inflight_htlcs, LDKThirtyTwoBytes _payment_hash, LDKThirtyTwoBytes _payment_id) { - 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); - 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 payer_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, payer_arr, 0, 33, payer.compressed_form); - LDKRouteParameters route_params_var = *route_params; - int64_t route_params_ref = 0; - route_params_var = RouteParameters_clone(&route_params_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var); - route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned); - LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops; - int64_tArray first_hops_arr = NULL; - if (first_hops != NULL) { - LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr; - first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen); - int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL); - for (size_t q = 0; q < first_hops_var.datalen; q++) { - LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q]; - int64_t first_hops_conv_16_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); - first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned); - first_hops_arr_ptr[q] = first_hops_conv_16_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0); - } - LDKInFlightHtlcs inflight_htlcs_var = inflight_htlcs; - int64_t inflight_htlcs_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var); - inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned); - int8_tArray _payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, _payment_hash_arr, 0, 32, _payment_hash.data); - int8_tArray _payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, _payment_id_arr, 0, 32, _payment_id.data); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_with_id_meth, payer_arr, route_params_ref, first_hops_arr, inflight_htlcs_ref, _payment_hash_arr, _payment_id_arr); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to find_route_with_id in LDKRouter from rust threw an exception."); - } - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(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_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); - 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); - LDKCVec_ChannelDetailsZ first_hops_var = first_hops; - int64_tArray first_hops_arr = NULL; - first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen); - int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL); - for (size_t q = 0; q < first_hops_var.datalen; q++) { - LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q]; - int64_t first_hops_conv_16_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); - first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned); - first_hops_arr_ptr[q] = first_hops_conv_16_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0); - FREE(first_hops_var.data); - LDKReceiveTlvs tlvs_var = tlvs; - int64_t tlvs_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_var); - tlvs_ref = tag_ptr(tlvs_var.inner, tlvs_var.is_owned); - int64_t amount_msats_conv = amount_msats; - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->create_blinded_payment_paths_meth, recipient_arr, first_hops_arr, tlvs_ref, amount_msats_conv); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to create_blinded_payment_paths in LDKRouter from rust threw an exception."); - } - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(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); - } - return ret_conv; -} -static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) { - LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); - atomic_fetch_add_explicit(&j_calls->MessageRouter->refcnt, 1, memory_order_release); -} -static inline LDKRouter LDKRouter_init (JNIEnv *env, jclass clz, jobject o, jobject MessageRouter) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->find_route_meth = (*env)->GetMethodID(env, c, "find_route", "([BJ[JJ)J"); - CHECK(calls->find_route_meth != NULL); - calls->find_route_with_id_meth = (*env)->GetMethodID(env, c, "find_route_with_id", "([BJ[JJ[B[B)J"); - CHECK(calls->find_route_with_id_meth != NULL); - calls->create_blinded_payment_paths_meth = (*env)->GetMethodID(env, c, "create_blinded_payment_paths", "([B[JJJ)J"); - CHECK(calls->create_blinded_payment_paths_meth != NULL); - - LDKRouter ret = { - .this_arg = (void*) calls, - .find_route = find_route_LDKRouter_jcall, - .find_route_with_id = find_route_with_id_LDKRouter_jcall, - .create_blinded_payment_paths = create_blinded_payment_paths_LDKRouter_jcall, - .free = LDKRouter_JCalls_free, - .MessageRouter = LDKMessageRouter_init(env, clz, MessageRouter), - }; - calls->MessageRouter = ret.MessageRouter.this_arg; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRouter_1new(JNIEnv *env, jclass clz, jobject o, jobject MessageRouter) { - LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter"); - *res_ptr = LDKRouter_init(env, clz, o, MessageRouter); - return tag_ptr(res_ptr, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRouter_1get_1MessageRouter(JNIEnv *env, jclass clz, int64_t arg) { - LDKRouter *inp = (LDKRouter *)untag_ptr(arg); - return tag_ptr(&inp->MessageRouter, false); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t route_params, int64_tArray first_hops, int64_t inflight_htlcs) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr; - LDKPublicKey payer_ref; - CHECK((*env)->GetArrayLength(env, payer) == 33); - (*env)->GetByteArrayRegion(env, payer, 0, 33, payer_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; - 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; - } - 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 = InFlightHtlcs_clone(&inflight_htlcs_conv); - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, &route_params_conv, first_hops_ptr, inflight_htlcs_conv); - if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route_1with_1id(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t route_params, int64_tArray first_hops, int64_t inflight_htlcs, int8_tArray _payment_hash, int8_tArray _payment_id) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr; - LDKPublicKey payer_ref; - CHECK((*env)->GetArrayLength(env, payer) == 33); - (*env)->GetByteArrayRegion(env, payer, 0, 33, payer_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; - 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; - } - 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 = InFlightHtlcs_clone(&inflight_htlcs_conv); - LDKThirtyTwoBytes _payment_hash_ref; - CHECK((*env)->GetArrayLength(env, _payment_hash) == 32); - (*env)->GetByteArrayRegion(env, _payment_hash, 0, 32, _payment_hash_ref.data); - LDKThirtyTwoBytes _payment_id_ref; - CHECK((*env)->GetArrayLength(env, _payment_id) == 32); - (*env)->GetByteArrayRegion(env, _payment_id, 0, 32, _payment_id_ref.data); - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = (this_arg_conv->find_route_with_id)(this_arg_conv->this_arg, payer_ref, &route_params_conv, first_hops_ptr, inflight_htlcs_conv, _payment_hash_ref, _payment_id_ref); - if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1create_1blinded_1payment_1paths(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray recipient, int64_tArray first_hops, int64_t tlvs, int64_t amount_msats) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr; - LDKPublicKey recipient_ref; - CHECK((*env)->GetArrayLength(env, recipient) == 33); - (*env)->GetByteArrayRegion(env, recipient, 0, 33, recipient_ref.compressed_form); - LDKCVec_ChannelDetailsZ first_hops_constr; - 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 = ChannelDetails_clone(&first_hops_conv_16_conv); - first_hops_constr.data[q] = first_hops_conv_16_conv; - } - (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0); - LDKReceiveTlvs tlvs_conv; - tlvs_conv.inner = untag_ptr(tlvs); - tlvs_conv.is_owned = ptr_is_owned(tlvs); - CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_conv); - tlvs_conv = ReceiveTlvs_clone(&tlvs_conv); - 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); -} - static inline struct LDKThirtyTwoBytes C2Tuple_ThirtyTwoBytesChannelManagerZ_get_a(LDKC2Tuple_ThirtyTwoBytesChannelManagerZ *NONNULL_PTR owner){ return ThirtyTwoBytes_clone(&owner->a); } @@ -11653,6 +11945,24 @@ static inline LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ CVec_C2Tup } return ret; } +static inline bool C2Tuple_boolboolZ_get_a(LDKC2Tuple_boolboolZ *NONNULL_PTR owner){ + return owner->a; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_C2Tuple_1boolboolZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_boolboolZ* owner_conv = (LDKC2Tuple_boolboolZ*)untag_ptr(owner); + jboolean ret_conv = C2Tuple_boolboolZ_get_a(owner_conv); + return ret_conv; +} + +static inline bool C2Tuple_boolboolZ_get_b(LDKC2Tuple_boolboolZ *NONNULL_PTR owner){ + return owner->b; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_C2Tuple_1boolboolZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_boolboolZ* owner_conv = (LDKC2Tuple_boolboolZ*)untag_ptr(owner); + jboolean ret_conv = C2Tuple_boolboolZ_get_b(owner_conv); + return ret_conv; +} + static jclass LDKBalance_ClaimableOnChannelClose_class = NULL; static jmethodID LDKBalance_ClaimableOnChannelClose_meth = NULL; static jclass LDKBalance_ClaimableAwaitingConfirmations_class = NULL; @@ -12575,6 +12885,73 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1StrZIOErrorZ_ return ret_conv; } +static inline struct LDKStr C3Tuple_StrStrStrZ_get_a(LDKC3Tuple_StrStrStrZ *NONNULL_PTR owner){ + return owner->a; +} +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_StrStrStrZ* owner_conv = (LDKC3Tuple_StrStrStrZ*)untag_ptr(owner); + LDKStr ret_str = C3Tuple_StrStrStrZ_get_a(owner_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + return ret_conv; +} + +static inline struct LDKStr C3Tuple_StrStrStrZ_get_b(LDKC3Tuple_StrStrStrZ *NONNULL_PTR owner){ + return owner->b; +} +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_StrStrStrZ* owner_conv = (LDKC3Tuple_StrStrStrZ*)untag_ptr(owner); + LDKStr ret_str = C3Tuple_StrStrStrZ_get_b(owner_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + return ret_conv; +} + +static inline struct LDKStr C3Tuple_StrStrStrZ_get_c(LDKC3Tuple_StrStrStrZ *NONNULL_PTR owner){ + return owner->c; +} +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_StrStrStrZ* owner_conv = (LDKC3Tuple_StrStrStrZ*)untag_ptr(owner); + LDKStr ret_str = C3Tuple_StrStrStrZ_get_c(owner_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + return ret_conv; +} + +static inline LDKCVec_C3Tuple_StrStrStrZZ CVec_C3Tuple_StrStrStrZZ_clone(const LDKCVec_C3Tuple_StrStrStrZZ *orig) { + LDKCVec_C3Tuple_StrStrStrZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_StrStrStrZ) * orig->datalen, "LDKCVec_C3Tuple_StrStrStrZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C3Tuple_StrStrStrZ_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKCVec_C3Tuple_StrStrStrZZ CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_get_ok(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return CVec_C3Tuple_StrStrStrZZ_clone(&*owner->contents.result); +} +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* owner_conv = (LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ*)untag_ptr(owner); + LDKCVec_C3Tuple_StrStrStrZZ ret_var = CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_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 x = 0; x < ret_var.datalen; x++) { + LDKC3Tuple_StrStrStrZ* ret_conv_23_conv = MALLOC(sizeof(LDKC3Tuple_StrStrStrZ), "LDKC3Tuple_StrStrStrZ"); + *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; +} + +static inline enum LDKIOError CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_get_err(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* owner_conv = (LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKIOError_to_java(env, CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_get_err(owner_conv)); + return ret_conv; +} + static inline LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ_clone(const LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ *orig) { LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ) * orig->datalen, "LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -12633,27 +13010,51 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoB return ret_conv; } -static inline struct LDKUnsignedInvoiceRequest CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner){ - LDKUnsignedInvoiceRequest ret = *owner->contents.result; +static inline struct LDKMonitorName CResult_MonitorNameIOErrorZ_get_ok(LDKCResult_MonitorNameIOErrorZ *NONNULL_PTR owner){ + LDKMonitorName ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); - LDKUnsignedInvoiceRequest ret_var = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1MonitorNameIOErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_MonitorNameIOErrorZ* owner_conv = (LDKCResult_MonitorNameIOErrorZ*)untag_ptr(owner); + LDKMonitorName ret_var = CResult_MonitorNameIOErrorZ_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 enum LDKBolt12SemanticError CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner){ +static inline enum LDKIOError CResult_MonitorNameIOErrorZ_get_err(LDKCResult_MonitorNameIOErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return Bolt12SemanticError_clone(&*owner->contents.err); + return *owner->contents.err; +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1MonitorNameIOErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_MonitorNameIOErrorZ* owner_conv = (LDKCResult_MonitorNameIOErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKIOError_to_java(env, CResult_MonitorNameIOErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKUpdateName CResult_UpdateNameIOErrorZ_get_ok(LDKCResult_UpdateNameIOErrorZ *NONNULL_PTR owner){ + LDKUpdateName ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateNameIOErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_UpdateNameIOErrorZ* owner_conv = (LDKCResult_UpdateNameIOErrorZ*)untag_ptr(owner); + LDKUpdateName ret_var = CResult_UpdateNameIOErrorZ_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 enum LDKIOError CResult_UpdateNameIOErrorZ_get_err(LDKCResult_UpdateNameIOErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKBolt12SemanticError_to_java(env, CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err(owner_conv)); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateNameIOErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_UpdateNameIOErrorZ* owner_conv = (LDKCResult_UpdateNameIOErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKIOError_to_java(env, CResult_UpdateNameIOErrorZ_get_err(owner_conv)); return ret_conv; } @@ -12752,6 +13153,32 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceWithDerivedS return ret_conv; } +static inline struct LDKInvoiceRequest CResult_InvoiceRequestDecodeErrorZ_get_ok(LDKCResult_InvoiceRequestDecodeErrorZ *NONNULL_PTR owner){ + LDKInvoiceRequest ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceRequestDecodeErrorZ* owner_conv = (LDKCResult_InvoiceRequestDecodeErrorZ*)untag_ptr(owner); + LDKInvoiceRequest ret_var = CResult_InvoiceRequestDecodeErrorZ_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_InvoiceRequestDecodeErrorZ_get_err(LDKCResult_InvoiceRequestDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceRequestDecodeErrorZ* owner_conv = (LDKCResult_InvoiceRequestDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_InvoiceRequestDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKInvoiceRequestFields CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok(LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR owner){ LDKInvoiceRequestFields ret = *owner->contents.result; ret.is_owned = false; @@ -15614,6 +16041,35 @@ static inline LDKCVec_ClaimedHTLCZ CVec_ClaimedHTLCZ_clone(const LDKCVec_Claimed } return ret; } +static jclass LDKInboundChannelFunds_PushMsat_class = NULL; +static jmethodID LDKInboundChannelFunds_PushMsat_meth = NULL; +static jclass LDKInboundChannelFunds_DualFunded_class = NULL; +static jmethodID LDKInboundChannelFunds_DualFunded_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKInboundChannelFunds_init (JNIEnv *env, jclass clz) { + LDKInboundChannelFunds_PushMsat_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKInboundChannelFunds$PushMsat")); + CHECK(LDKInboundChannelFunds_PushMsat_class != NULL); + LDKInboundChannelFunds_PushMsat_meth = (*env)->GetMethodID(env, LDKInboundChannelFunds_PushMsat_class, "", "(J)V"); + CHECK(LDKInboundChannelFunds_PushMsat_meth != NULL); + LDKInboundChannelFunds_DualFunded_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKInboundChannelFunds$DualFunded")); + CHECK(LDKInboundChannelFunds_DualFunded_class != NULL); + LDKInboundChannelFunds_DualFunded_meth = (*env)->GetMethodID(env, LDKInboundChannelFunds_DualFunded_class, "", "()V"); + CHECK(LDKInboundChannelFunds_DualFunded_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKInboundChannelFunds_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKInboundChannelFunds *obj = (LDKInboundChannelFunds*)untag_ptr(ptr); + switch(obj->tag) { + case LDKInboundChannelFunds_PushMsat: { + int64_t push_msat_conv = obj->push_msat; + return (*env)->NewObject(env, LDKInboundChannelFunds_PushMsat_class, LDKInboundChannelFunds_PushMsat_meth, push_msat_conv); + } + case LDKInboundChannelFunds_DualFunded: { + return (*env)->NewObject(env, LDKInboundChannelFunds_DualFunded_class, LDKInboundChannelFunds_DualFunded_meth); + } + default: abort(); + } +} static jclass LDKBumpTransactionEvent_ChannelClose_class = NULL; static jmethodID LDKBumpTransactionEvent_ChannelClose_meth = NULL; static jclass LDKBumpTransactionEvent_HTLCResolution_class = NULL; @@ -15757,12 +16213,12 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en LDKEvent_PaymentClaimable_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentClaimable")); CHECK(LDKEvent_PaymentClaimable_class != NULL); - LDKEvent_PaymentClaimable_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimable_class, "", "([B[BJJJJJJJ)V"); + LDKEvent_PaymentClaimable_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimable_class, "", "([B[BJJJJJJJJ)V"); CHECK(LDKEvent_PaymentClaimable_meth != NULL); 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[JJJ)V"); + LDKEvent_PaymentClaimed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimed_class, "", "([B[BJJ[JJJJ)V"); CHECK(LDKEvent_PaymentClaimed_meth != NULL); LDKEvent_ConnectionNeeded_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ConnectionNeeded")); @@ -15822,7 +16278,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en LDKEvent_PaymentForwarded_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentForwarded")); CHECK(LDKEvent_PaymentForwarded_class != NULL); - LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "", "(JJJJJJZJ)V"); + LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "", "(JJJJ[B[BJJZJ)V"); CHECK(LDKEvent_PaymentForwarded_meth != NULL); LDKEvent_ChannelPending_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelPending")); @@ -15837,7 +16293,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en LDKEvent_ChannelClosed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelClosed")); CHECK(LDKEvent_ChannelClosed_class != NULL); - LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "", "(J[BJ[BJJ)V"); + LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "", "(J[BJ[BJJJ)V"); CHECK(LDKEvent_ChannelClosed_meth != NULL); LDKEvent_DiscardFunding_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$DiscardFunding")); @@ -15925,7 +16381,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN via_channel_id_ref = tag_ptr(via_channel_id_var.inner, false); int64_t via_user_channel_id_ref = tag_ptr(&obj->payment_claimable.via_user_channel_id, false); int64_t claim_deadline_ref = tag_ptr(&obj->payment_claimable.claim_deadline, false); - return (*env)->NewObject(env, LDKEvent_PaymentClaimable_class, LDKEvent_PaymentClaimable_meth, receiver_node_id_arr, payment_hash_arr, onion_fields_ref, amount_msat_conv, counterparty_skimmed_fee_msat_conv, purpose_ref, via_channel_id_ref, via_user_channel_id_ref, claim_deadline_ref); + int64_t payment_id_ref = tag_ptr(&obj->payment_claimable.payment_id, false); + return (*env)->NewObject(env, LDKEvent_PaymentClaimable_class, LDKEvent_PaymentClaimable_meth, receiver_node_id_arr, payment_hash_arr, onion_fields_ref, amount_msat_conv, counterparty_skimmed_fee_msat_conv, purpose_ref, via_channel_id_ref, via_user_channel_id_ref, claim_deadline_ref, payment_id_ref); } case LDKEvent_PaymentClaimed: { int8_tArray receiver_node_id_arr = (*env)->NewByteArray(env, 33); @@ -15951,7 +16408,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN 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); + int64_t payment_id_ref = tag_ptr(&obj->payment_claimed.payment_id, 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, payment_id_ref); } case LDKEvent_ConnectionNeeded: { int8_tArray node_id_arr = (*env)->NewByteArray(env, 33); @@ -16084,11 +16542,15 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN next_channel_id_ref = tag_ptr(next_channel_id_var.inner, false); int64_t prev_user_channel_id_ref = tag_ptr(&obj->payment_forwarded.prev_user_channel_id, false); int64_t next_user_channel_id_ref = tag_ptr(&obj->payment_forwarded.next_user_channel_id, false); + int8_tArray prev_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, prev_node_id_arr, 0, 33, obj->payment_forwarded.prev_node_id.compressed_form); + int8_tArray next_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, next_node_id_arr, 0, 33, obj->payment_forwarded.next_node_id.compressed_form); int64_t total_fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.total_fee_earned_msat, false); int64_t skimmed_fee_msat_ref = tag_ptr(&obj->payment_forwarded.skimmed_fee_msat, false); jboolean claim_from_onchain_tx_conv = obj->payment_forwarded.claim_from_onchain_tx; int64_t outbound_amount_forwarded_msat_ref = tag_ptr(&obj->payment_forwarded.outbound_amount_forwarded_msat, false); - return (*env)->NewObject(env, LDKEvent_PaymentForwarded_class, LDKEvent_PaymentForwarded_meth, prev_channel_id_ref, next_channel_id_ref, prev_user_channel_id_ref, next_user_channel_id_ref, total_fee_earned_msat_ref, skimmed_fee_msat_ref, claim_from_onchain_tx_conv, outbound_amount_forwarded_msat_ref); + return (*env)->NewObject(env, LDKEvent_PaymentForwarded_class, LDKEvent_PaymentForwarded_meth, prev_channel_id_ref, next_channel_id_ref, prev_user_channel_id_ref, next_user_channel_id_ref, prev_node_id_arr, next_node_id_arr, total_fee_earned_msat_ref, skimmed_fee_msat_ref, claim_from_onchain_tx_conv, outbound_amount_forwarded_msat_ref); } case LDKEvent_ChannelPending: { LDKChannelId channel_id_var = obj->channel_pending.channel_id; @@ -16143,7 +16605,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN int64_t channel_funding_txo_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_txo_var); channel_funding_txo_ref = tag_ptr(channel_funding_txo_var.inner, false); - return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_ref, user_channel_id_arr, reason_ref, counterparty_node_id_arr, channel_capacity_sats_ref, channel_funding_txo_ref); + int64_t last_local_balance_msat_ref = tag_ptr(&obj->channel_closed.last_local_balance_msat, false); + return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_ref, user_channel_id_arr, reason_ref, counterparty_node_id_arr, channel_capacity_sats_ref, channel_funding_txo_ref, last_local_balance_msat_ref); } case LDKEvent_DiscardFunding: { LDKChannelId channel_id_var = obj->discard_funding.channel_id; @@ -16161,7 +16624,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->open_channel_request.counterparty_node_id.compressed_form); int64_t funding_satoshis_conv = obj->open_channel_request.funding_satoshis; - int64_t push_msat_conv = obj->open_channel_request.push_msat; + int64_t channel_negotiation_type_ref = tag_ptr(&obj->open_channel_request.channel_negotiation_type, false); LDKChannelTypeFeatures channel_type_var = obj->open_channel_request.channel_type; int64_t channel_type_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var); @@ -16171,7 +16634,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN 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); + return (*env)->NewObject(env, LDKEvent_OpenChannelRequest_class, LDKEvent_OpenChannelRequest_meth, temporary_channel_id_ref, counterparty_node_id_arr, funding_satoshis_conv, channel_negotiation_type_ref, channel_type_ref, is_announced_conv, params_ref); } case LDKEvent_HTLCHandlingFailed: { LDKChannelId prev_channel_id_var = obj->htlc_handling_failed.prev_channel_id; @@ -16288,200 +16751,6 @@ static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_Route } return ret; } -static jclass LDKBolt11ParseError_Bech32Error_class = NULL; -static jmethodID LDKBolt11ParseError_Bech32Error_meth = NULL; -static jclass LDKBolt11ParseError_ParseAmountError_class = NULL; -static jmethodID LDKBolt11ParseError_ParseAmountError_meth = NULL; -static jclass LDKBolt11ParseError_MalformedSignature_class = NULL; -static jmethodID LDKBolt11ParseError_MalformedSignature_meth = NULL; -static jclass LDKBolt11ParseError_BadPrefix_class = NULL; -static jmethodID LDKBolt11ParseError_BadPrefix_meth = NULL; -static jclass LDKBolt11ParseError_UnknownCurrency_class = NULL; -static jmethodID LDKBolt11ParseError_UnknownCurrency_meth = NULL; -static jclass LDKBolt11ParseError_UnknownSiPrefix_class = NULL; -static jmethodID LDKBolt11ParseError_UnknownSiPrefix_meth = NULL; -static jclass LDKBolt11ParseError_MalformedHRP_class = NULL; -static jmethodID LDKBolt11ParseError_MalformedHRP_meth = NULL; -static jclass LDKBolt11ParseError_TooShortDataPart_class = NULL; -static jmethodID LDKBolt11ParseError_TooShortDataPart_meth = NULL; -static jclass LDKBolt11ParseError_UnexpectedEndOfTaggedFields_class = NULL; -static jmethodID LDKBolt11ParseError_UnexpectedEndOfTaggedFields_meth = NULL; -static jclass LDKBolt11ParseError_DescriptionDecodeError_class = NULL; -static jmethodID LDKBolt11ParseError_DescriptionDecodeError_meth = NULL; -static jclass LDKBolt11ParseError_PaddingError_class = NULL; -static jmethodID LDKBolt11ParseError_PaddingError_meth = NULL; -static jclass LDKBolt11ParseError_IntegerOverflowError_class = NULL; -static jmethodID LDKBolt11ParseError_IntegerOverflowError_meth = NULL; -static jclass LDKBolt11ParseError_InvalidSegWitProgramLength_class = NULL; -static jmethodID LDKBolt11ParseError_InvalidSegWitProgramLength_meth = NULL; -static jclass LDKBolt11ParseError_InvalidPubKeyHashLength_class = NULL; -static jmethodID LDKBolt11ParseError_InvalidPubKeyHashLength_meth = NULL; -static jclass LDKBolt11ParseError_InvalidScriptHashLength_class = NULL; -static jmethodID LDKBolt11ParseError_InvalidScriptHashLength_meth = NULL; -static jclass LDKBolt11ParseError_InvalidRecoveryId_class = NULL; -static jmethodID LDKBolt11ParseError_InvalidRecoveryId_meth = NULL; -static jclass LDKBolt11ParseError_InvalidSliceLength_class = NULL; -static jmethodID LDKBolt11ParseError_InvalidSliceLength_meth = NULL; -static jclass LDKBolt11ParseError_Skip_class = NULL; -static jmethodID LDKBolt11ParseError_Skip_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBolt11ParseError_init (JNIEnv *env, jclass clz) { - LDKBolt11ParseError_Bech32Error_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$Bech32Error")); - CHECK(LDKBolt11ParseError_Bech32Error_class != NULL); - LDKBolt11ParseError_Bech32Error_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_Bech32Error_class, "", "(J)V"); - CHECK(LDKBolt11ParseError_Bech32Error_meth != NULL); - LDKBolt11ParseError_ParseAmountError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$ParseAmountError")); - CHECK(LDKBolt11ParseError_ParseAmountError_class != NULL); - LDKBolt11ParseError_ParseAmountError_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_ParseAmountError_class, "", "(I)V"); - CHECK(LDKBolt11ParseError_ParseAmountError_meth != NULL); - LDKBolt11ParseError_MalformedSignature_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$MalformedSignature")); - CHECK(LDKBolt11ParseError_MalformedSignature_class != NULL); - LDKBolt11ParseError_MalformedSignature_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_MalformedSignature_class, "", "(Lorg/ldk/enums/Secp256k1Error;)V"); - CHECK(LDKBolt11ParseError_MalformedSignature_meth != NULL); - LDKBolt11ParseError_BadPrefix_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$BadPrefix")); - CHECK(LDKBolt11ParseError_BadPrefix_class != NULL); - LDKBolt11ParseError_BadPrefix_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_BadPrefix_class, "", "()V"); - CHECK(LDKBolt11ParseError_BadPrefix_meth != NULL); - LDKBolt11ParseError_UnknownCurrency_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$UnknownCurrency")); - CHECK(LDKBolt11ParseError_UnknownCurrency_class != NULL); - LDKBolt11ParseError_UnknownCurrency_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_UnknownCurrency_class, "", "()V"); - CHECK(LDKBolt11ParseError_UnknownCurrency_meth != NULL); - LDKBolt11ParseError_UnknownSiPrefix_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$UnknownSiPrefix")); - CHECK(LDKBolt11ParseError_UnknownSiPrefix_class != NULL); - LDKBolt11ParseError_UnknownSiPrefix_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_UnknownSiPrefix_class, "", "()V"); - CHECK(LDKBolt11ParseError_UnknownSiPrefix_meth != NULL); - LDKBolt11ParseError_MalformedHRP_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$MalformedHRP")); - CHECK(LDKBolt11ParseError_MalformedHRP_class != NULL); - LDKBolt11ParseError_MalformedHRP_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_MalformedHRP_class, "", "()V"); - CHECK(LDKBolt11ParseError_MalformedHRP_meth != NULL); - LDKBolt11ParseError_TooShortDataPart_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$TooShortDataPart")); - CHECK(LDKBolt11ParseError_TooShortDataPart_class != NULL); - LDKBolt11ParseError_TooShortDataPart_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_TooShortDataPart_class, "", "()V"); - CHECK(LDKBolt11ParseError_TooShortDataPart_meth != NULL); - LDKBolt11ParseError_UnexpectedEndOfTaggedFields_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$UnexpectedEndOfTaggedFields")); - CHECK(LDKBolt11ParseError_UnexpectedEndOfTaggedFields_class != NULL); - LDKBolt11ParseError_UnexpectedEndOfTaggedFields_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_UnexpectedEndOfTaggedFields_class, "", "()V"); - CHECK(LDKBolt11ParseError_UnexpectedEndOfTaggedFields_meth != NULL); - LDKBolt11ParseError_DescriptionDecodeError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$DescriptionDecodeError")); - CHECK(LDKBolt11ParseError_DescriptionDecodeError_class != NULL); - LDKBolt11ParseError_DescriptionDecodeError_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_DescriptionDecodeError_class, "", "(I)V"); - CHECK(LDKBolt11ParseError_DescriptionDecodeError_meth != NULL); - LDKBolt11ParseError_PaddingError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$PaddingError")); - CHECK(LDKBolt11ParseError_PaddingError_class != NULL); - LDKBolt11ParseError_PaddingError_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_PaddingError_class, "", "()V"); - CHECK(LDKBolt11ParseError_PaddingError_meth != NULL); - LDKBolt11ParseError_IntegerOverflowError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$IntegerOverflowError")); - CHECK(LDKBolt11ParseError_IntegerOverflowError_class != NULL); - LDKBolt11ParseError_IntegerOverflowError_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_IntegerOverflowError_class, "", "()V"); - CHECK(LDKBolt11ParseError_IntegerOverflowError_meth != NULL); - LDKBolt11ParseError_InvalidSegWitProgramLength_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$InvalidSegWitProgramLength")); - CHECK(LDKBolt11ParseError_InvalidSegWitProgramLength_class != NULL); - LDKBolt11ParseError_InvalidSegWitProgramLength_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_InvalidSegWitProgramLength_class, "", "()V"); - CHECK(LDKBolt11ParseError_InvalidSegWitProgramLength_meth != NULL); - LDKBolt11ParseError_InvalidPubKeyHashLength_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$InvalidPubKeyHashLength")); - CHECK(LDKBolt11ParseError_InvalidPubKeyHashLength_class != NULL); - LDKBolt11ParseError_InvalidPubKeyHashLength_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_InvalidPubKeyHashLength_class, "", "()V"); - CHECK(LDKBolt11ParseError_InvalidPubKeyHashLength_meth != NULL); - LDKBolt11ParseError_InvalidScriptHashLength_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$InvalidScriptHashLength")); - CHECK(LDKBolt11ParseError_InvalidScriptHashLength_class != NULL); - LDKBolt11ParseError_InvalidScriptHashLength_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_InvalidScriptHashLength_class, "", "()V"); - CHECK(LDKBolt11ParseError_InvalidScriptHashLength_meth != NULL); - LDKBolt11ParseError_InvalidRecoveryId_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$InvalidRecoveryId")); - CHECK(LDKBolt11ParseError_InvalidRecoveryId_class != NULL); - LDKBolt11ParseError_InvalidRecoveryId_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_InvalidRecoveryId_class, "", "()V"); - CHECK(LDKBolt11ParseError_InvalidRecoveryId_meth != NULL); - LDKBolt11ParseError_InvalidSliceLength_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$InvalidSliceLength")); - CHECK(LDKBolt11ParseError_InvalidSliceLength_class != NULL); - LDKBolt11ParseError_InvalidSliceLength_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_InvalidSliceLength_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKBolt11ParseError_InvalidSliceLength_meth != NULL); - LDKBolt11ParseError_Skip_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$Skip")); - CHECK(LDKBolt11ParseError_Skip_class != NULL); - LDKBolt11ParseError_Skip_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_Skip_class, "", "()V"); - CHECK(LDKBolt11ParseError_Skip_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBolt11ParseError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKBolt11ParseError *obj = (LDKBolt11ParseError*)untag_ptr(ptr); - switch(obj->tag) { - case LDKBolt11ParseError_Bech32Error: { - int64_t bech32_error_ref = tag_ptr(&obj->bech32_error, false); - return (*env)->NewObject(env, LDKBolt11ParseError_Bech32Error_class, LDKBolt11ParseError_Bech32Error_meth, bech32_error_ref); - } - case LDKBolt11ParseError_ParseAmountError: { - /*obj->parse_amount_error*/ - return (*env)->NewObject(env, LDKBolt11ParseError_ParseAmountError_class, LDKBolt11ParseError_ParseAmountError_meth, 0); - } - case LDKBolt11ParseError_MalformedSignature: { - jclass malformed_signature_conv = LDKSecp256k1Error_to_java(env, obj->malformed_signature); - return (*env)->NewObject(env, LDKBolt11ParseError_MalformedSignature_class, LDKBolt11ParseError_MalformedSignature_meth, malformed_signature_conv); - } - case LDKBolt11ParseError_BadPrefix: { - return (*env)->NewObject(env, LDKBolt11ParseError_BadPrefix_class, LDKBolt11ParseError_BadPrefix_meth); - } - case LDKBolt11ParseError_UnknownCurrency: { - return (*env)->NewObject(env, LDKBolt11ParseError_UnknownCurrency_class, LDKBolt11ParseError_UnknownCurrency_meth); - } - case LDKBolt11ParseError_UnknownSiPrefix: { - return (*env)->NewObject(env, LDKBolt11ParseError_UnknownSiPrefix_class, LDKBolt11ParseError_UnknownSiPrefix_meth); - } - case LDKBolt11ParseError_MalformedHRP: { - return (*env)->NewObject(env, LDKBolt11ParseError_MalformedHRP_class, LDKBolt11ParseError_MalformedHRP_meth); - } - case LDKBolt11ParseError_TooShortDataPart: { - return (*env)->NewObject(env, LDKBolt11ParseError_TooShortDataPart_class, LDKBolt11ParseError_TooShortDataPart_meth); - } - case LDKBolt11ParseError_UnexpectedEndOfTaggedFields: { - return (*env)->NewObject(env, LDKBolt11ParseError_UnexpectedEndOfTaggedFields_class, LDKBolt11ParseError_UnexpectedEndOfTaggedFields_meth); - } - case LDKBolt11ParseError_DescriptionDecodeError: { - /*obj->description_decode_error*/ - return (*env)->NewObject(env, LDKBolt11ParseError_DescriptionDecodeError_class, LDKBolt11ParseError_DescriptionDecodeError_meth, 0); - } - case LDKBolt11ParseError_PaddingError: { - return (*env)->NewObject(env, LDKBolt11ParseError_PaddingError_class, LDKBolt11ParseError_PaddingError_meth); - } - case LDKBolt11ParseError_IntegerOverflowError: { - return (*env)->NewObject(env, LDKBolt11ParseError_IntegerOverflowError_class, LDKBolt11ParseError_IntegerOverflowError_meth); - } - case LDKBolt11ParseError_InvalidSegWitProgramLength: { - return (*env)->NewObject(env, LDKBolt11ParseError_InvalidSegWitProgramLength_class, LDKBolt11ParseError_InvalidSegWitProgramLength_meth); - } - case LDKBolt11ParseError_InvalidPubKeyHashLength: { - return (*env)->NewObject(env, LDKBolt11ParseError_InvalidPubKeyHashLength_class, LDKBolt11ParseError_InvalidPubKeyHashLength_meth); - } - case LDKBolt11ParseError_InvalidScriptHashLength: { - return (*env)->NewObject(env, LDKBolt11ParseError_InvalidScriptHashLength_class, LDKBolt11ParseError_InvalidScriptHashLength_meth); - } - case LDKBolt11ParseError_InvalidRecoveryId: { - return (*env)->NewObject(env, LDKBolt11ParseError_InvalidRecoveryId_class, LDKBolt11ParseError_InvalidRecoveryId_meth); - } - case LDKBolt11ParseError_InvalidSliceLength: { - LDKStr invalid_slice_length_str = obj->invalid_slice_length; - jstring invalid_slice_length_conv = str_ref_to_java(env, invalid_slice_length_str.chars, invalid_slice_length_str.len); - return (*env)->NewObject(env, LDKBolt11ParseError_InvalidSliceLength_class, LDKBolt11ParseError_InvalidSliceLength_meth, invalid_slice_length_conv); - } - case LDKBolt11ParseError_Skip: { - return (*env)->NewObject(env, LDKBolt11ParseError_Skip_class, LDKBolt11ParseError_Skip_meth); - } - default: abort(); - } -} static inline enum LDKSiPrefix CResult_SiPrefixBolt11ParseErrorZ_get_ok(LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return SiPrefix_clone(&*owner->contents.result); @@ -16493,14 +16762,16 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixBolt11Parse } static inline struct LDKBolt11ParseError CResult_SiPrefixBolt11ParseErrorZ_get_err(LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return Bolt11ParseError_clone(&*owner->contents.err); + LDKBolt11ParseError ret = *owner->contents.err; + ret.is_owned = false; + return ret; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixBolt11ParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { LDKCResult_SiPrefixBolt11ParseErrorZ* owner_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(owner); - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = CResult_SiPrefixBolt11ParseErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKBolt11ParseError ret_var = CResult_SiPrefixBolt11ParseErrorZ_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; } @@ -16524,7 +16795,10 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseOrSemanticError_1re LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr); switch(obj->tag) { case LDKParseOrSemanticError_ParseError: { - int64_t parse_error_ref = tag_ptr(&obj->parse_error, false); + LDKBolt11ParseError parse_error_var = obj->parse_error; + int64_t parse_error_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(parse_error_var); + parse_error_ref = tag_ptr(parse_error_var.inner, false); return (*env)->NewObject(env, LDKParseOrSemanticError_ParseError_class, LDKParseOrSemanticError_ParseError_meth, parse_error_ref); } case LDKParseOrSemanticError_SemanticError: { @@ -16575,14 +16849,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawBolt11Inv } static inline struct LDKBolt11ParseError CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_get_err(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return Bolt11ParseError_clone(&*owner->contents.err); + LDKBolt11ParseError ret = *owner->contents.err; + ret.is_owned = false; + return ret; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawBolt11InvoiceBolt11ParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* owner_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(owner); - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKBolt11ParseError ret_var = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_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; } @@ -16949,6 +17225,188 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelIdDecodeErr return ret_ref; } +static inline struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKInitFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKInitFeatures ret_var = CResult_InitFeaturesDecodeErrorZ_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_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKChannelFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKChannelFeatures ret_var = CResult_ChannelFeaturesDecodeErrorZ_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_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKNodeFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKNodeFeatures ret_var = CResult_NodeFeaturesDecodeErrorZ_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_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBolt11InvoiceFeatures CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKBolt11InvoiceFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKBolt11InvoiceFeatures ret_var = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_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_Bolt11InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBolt12InvoiceFeatures CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKBolt12InvoiceFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKBolt12InvoiceFeatures ret_var = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_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_Bolt12InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBlindedHopFeatures CResult_BlindedHopFeaturesDecodeErrorZ_get_ok(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedHopFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedHopFeaturesDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKBlindedHopFeatures ret_var = CResult_BlindedHopFeaturesDecodeErrorZ_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_BlindedHopFeaturesDecodeErrorZ_get_err(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedHopFeaturesDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BlindedHopFeaturesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKChannelTypeFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKChannelTypeFeatures ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_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_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKThirtyTwoBytes C2Tuple__u832u16Z_get_a(LDKC2Tuple__u832u16Z *NONNULL_PTR owner){ return ThirtyTwoBytes_clone(&owner->a); } @@ -17100,32 +17558,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentContextDeco return ret_ref; } -static inline struct LDKUnknownPaymentContext CResult_UnknownPaymentContextDecodeErrorZ_get_ok(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR owner){ - LDKUnknownPaymentContext ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* owner_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(owner); - LDKUnknownPaymentContext ret_var = CResult_UnknownPaymentContextDecodeErrorZ_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_UnknownPaymentContextDecodeErrorZ_get_err(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* owner_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_UnknownPaymentContextDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - static inline struct LDKBolt12OfferContext CResult_Bolt12OfferContextDecodeErrorZ_get_ok(LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR owner){ LDKBolt12OfferContext ret = *owner->contents.result; ret.is_owned = false; @@ -17435,6 +17867,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNextMessageHop_1ref_1fro } static jclass LDKParsedOnionMessageContents_Offers_class = NULL; static jmethodID LDKParsedOnionMessageContents_Offers_meth = NULL; +static jclass LDKParsedOnionMessageContents_DNSResolver_class = NULL; +static jmethodID LDKParsedOnionMessageContents_DNSResolver_meth = NULL; static jclass LDKParsedOnionMessageContents_Custom_class = NULL; static jmethodID LDKParsedOnionMessageContents_Custom_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParsedOnionMessageContents_init (JNIEnv *env, jclass clz) { @@ -17443,6 +17877,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParsedOnionMessageCont CHECK(LDKParsedOnionMessageContents_Offers_class != NULL); LDKParsedOnionMessageContents_Offers_meth = (*env)->GetMethodID(env, LDKParsedOnionMessageContents_Offers_class, "", "(J)V"); CHECK(LDKParsedOnionMessageContents_Offers_meth != NULL); + LDKParsedOnionMessageContents_DNSResolver_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParsedOnionMessageContents$DNSResolver")); + CHECK(LDKParsedOnionMessageContents_DNSResolver_class != NULL); + LDKParsedOnionMessageContents_DNSResolver_meth = (*env)->GetMethodID(env, LDKParsedOnionMessageContents_DNSResolver_class, "", "(J)V"); + CHECK(LDKParsedOnionMessageContents_DNSResolver_meth != NULL); LDKParsedOnionMessageContents_Custom_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParsedOnionMessageContents$Custom")); CHECK(LDKParsedOnionMessageContents_Custom_class != NULL); @@ -17456,6 +17895,10 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParsedOnionMessageConten int64_t offers_ref = tag_ptr(&obj->offers, false); return (*env)->NewObject(env, LDKParsedOnionMessageContents_Offers_class, LDKParsedOnionMessageContents_Offers_meth, offers_ref); } + case LDKParsedOnionMessageContents_DNSResolver: { + int64_t dns_resolver_ref = tag_ptr(&obj->dns_resolver, false); + return (*env)->NewObject(env, LDKParsedOnionMessageContents_DNSResolver_class, LDKParsedOnionMessageContents_DNSResolver_meth, dns_resolver_ref); + } case LDKParsedOnionMessageContents_Custom: { LDKOnionMessageContents* custom_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); *custom_ret = OnionMessageContents_clone(&obj->custom); @@ -17632,61 +18075,6 @@ static inline LDKCVec_PhantomRouteHintsZ CVec_PhantomRouteHintsZ_clone(const LDK } 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 inline struct LDKInvoiceError CResult_InvoiceErrorDecodeErrorZ_get_ok(LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR owner){ LDKInvoiceError ret = *owner->contents.result; ret.is_owned = false; @@ -18900,6 +19288,147 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecod return ret_ref; } +static inline struct LDKAsyncPaymentsContext CResult_AsyncPaymentsContextDecodeErrorZ_get_ok(LDKCResult_AsyncPaymentsContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return AsyncPaymentsContext_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_AsyncPaymentsContextDecodeErrorZ* owner_conv = (LDKCResult_AsyncPaymentsContextDecodeErrorZ*)untag_ptr(owner); + LDKAsyncPaymentsContext *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsContext), "LDKAsyncPaymentsContext"); + *ret_copy = CResult_AsyncPaymentsContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_AsyncPaymentsContextDecodeErrorZ_get_err(LDKCResult_AsyncPaymentsContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_AsyncPaymentsContextDecodeErrorZ* owner_conv = (LDKCResult_AsyncPaymentsContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_AsyncPaymentsContextDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDNSResolverContext CResult_DNSResolverContextDecodeErrorZ_get_ok(LDKCResult_DNSResolverContextDecodeErrorZ *NONNULL_PTR owner){ + LDKDNSResolverContext ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_DNSResolverContextDecodeErrorZ* owner_conv = (LDKCResult_DNSResolverContextDecodeErrorZ*)untag_ptr(owner); + LDKDNSResolverContext ret_var = CResult_DNSResolverContextDecodeErrorZ_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_DNSResolverContextDecodeErrorZ_get_err(LDKCResult_DNSResolverContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_DNSResolverContextDecodeErrorZ* owner_conv = (LDKCResult_DNSResolverContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_DNSResolverContextDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +typedef struct LDKMigratableKVStore_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + LDKKVStore_JCalls* KVStore; + jmethodID list_all_keys_meth; +} LDKMigratableKVStore_JCalls; +static void LDKMigratableKVStore_JCalls_free(void* this_arg) { + LDKMigratableKVStore_JCalls *j_calls = (LDKMigratableKVStore_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); + } +} +LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ list_all_keys_LDKMigratableKVStore_jcall(const void* this_arg) { + LDKMigratableKVStore_JCalls *j_calls = (LDKMigratableKVStore_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); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->list_all_keys_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to list_all_keys in LDKMigratableKVStore from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ ret_conv = *(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ*)(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 LDKMigratableKVStore_JCalls_cloned(LDKMigratableKVStore* new_obj) { + LDKMigratableKVStore_JCalls *j_calls = (LDKMigratableKVStore_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + atomic_fetch_add_explicit(&j_calls->KVStore->refcnt, 1, memory_order_release); +} +static inline LDKMigratableKVStore LDKMigratableKVStore_init (JNIEnv *env, jclass clz, jobject o, jobject KVStore) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKMigratableKVStore_JCalls *calls = MALLOC(sizeof(LDKMigratableKVStore_JCalls), "LDKMigratableKVStore_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->list_all_keys_meth = (*env)->GetMethodID(env, c, "list_all_keys", "()J"); + CHECK(calls->list_all_keys_meth != NULL); + + LDKMigratableKVStore ret = { + .this_arg = (void*) calls, + .list_all_keys = list_all_keys_LDKMigratableKVStore_jcall, + .free = LDKMigratableKVStore_JCalls_free, + .KVStore = LDKKVStore_init(env, clz, KVStore), + }; + calls->KVStore = ret.KVStore.this_arg; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKMigratableKVStore_1new(JNIEnv *env, jclass clz, jobject o, jobject KVStore) { + LDKMigratableKVStore *res_ptr = MALLOC(sizeof(LDKMigratableKVStore), "LDKMigratableKVStore"); + *res_ptr = LDKMigratableKVStore_init(env, clz, o, KVStore); + return tag_ptr(res_ptr, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKMigratableKVStore_1get_1KVStore(JNIEnv *env, jclass clz, int64_t arg) { + LDKMigratableKVStore *inp = (LDKMigratableKVStore *)untag_ptr(arg); + return tag_ptr(&inp->KVStore, false); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MigratableKVStore_1list_1all_1keys(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); } + LDKMigratableKVStore* this_arg_conv = (LDKMigratableKVStore*)this_arg_ptr; + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ), "LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ"); + *ret_conv = (this_arg_conv->list_all_keys)(this_arg_conv->this_arg); + return tag_ptr(ret_conv, true); +} + typedef struct LDKPersister_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -19996,6 +20525,169 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1process_1pendi (this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_conv); } +typedef struct LDKVerification_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID hmac_for_offer_payment_meth; + jmethodID verify_for_offer_payment_meth; +} LDKVerification_JCalls; +static void LDKVerification_JCalls_free(void* this_arg) { + LDKVerification_JCalls *j_calls = (LDKVerification_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); + } +} +LDKThirtyTwoBytes hmac_for_offer_payment_LDKVerification_jcall(const void* this_arg, LDKNonce nonce, const LDKExpandedKey * expanded_key) { + LDKVerification_JCalls *j_calls = (LDKVerification_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); + } + LDKNonce nonce_var = nonce; + int64_t nonce_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_var); + nonce_ref = tag_ptr(nonce_var.inner, nonce_var.is_owned); + LDKExpandedKey expanded_key_var = *expanded_key; + int64_t expanded_key_ref = 0; + expanded_key_var = ExpandedKey_clone(&expanded_key_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_var); + expanded_key_ref = tag_ptr(expanded_key_var.inner, expanded_key_var.is_owned); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->hmac_for_offer_payment_meth, nonce_ref, expanded_key_ref); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to hmac_for_offer_payment in LDKVerification from rust threw an exception."); + } + LDKThirtyTwoBytes ret_ref; + CHECK((*env)->GetArrayLength(env, ret) == 32); + (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_ref; +} +LDKCResult_NoneNoneZ verify_for_offer_payment_LDKVerification_jcall(const void* this_arg, LDKThirtyTwoBytes hmac, LDKNonce nonce, const LDKExpandedKey * expanded_key) { + LDKVerification_JCalls *j_calls = (LDKVerification_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 hmac_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, hmac_arr, 0, 32, hmac.data); + LDKNonce nonce_var = nonce; + int64_t nonce_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_var); + nonce_ref = tag_ptr(nonce_var.inner, nonce_var.is_owned); + LDKExpandedKey expanded_key_var = *expanded_key; + int64_t expanded_key_ref = 0; + expanded_key_var = ExpandedKey_clone(&expanded_key_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_var); + expanded_key_ref = tag_ptr(expanded_key_var.inner, expanded_key_var.is_owned); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->verify_for_offer_payment_meth, hmac_arr, nonce_ref, expanded_key_ref); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to verify_for_offer_payment in LDKVerification 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; +} +static void LDKVerification_JCalls_cloned(LDKVerification* new_obj) { + LDKVerification_JCalls *j_calls = (LDKVerification_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKVerification LDKVerification_init (JNIEnv *env, jclass clz, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKVerification_JCalls *calls = MALLOC(sizeof(LDKVerification_JCalls), "LDKVerification_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->hmac_for_offer_payment_meth = (*env)->GetMethodID(env, c, "hmac_for_offer_payment", "(JJ)[B"); + CHECK(calls->hmac_for_offer_payment_meth != NULL); + calls->verify_for_offer_payment_meth = (*env)->GetMethodID(env, c, "verify_for_offer_payment", "([BJJ)J"); + CHECK(calls->verify_for_offer_payment_meth != NULL); + + LDKVerification ret = { + .this_arg = (void*) calls, + .hmac_for_offer_payment = hmac_for_offer_payment_LDKVerification_jcall, + .verify_for_offer_payment = verify_for_offer_payment_LDKVerification_jcall, + .free = LDKVerification_JCalls_free, + }; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKVerification_1new(JNIEnv *env, jclass clz, jobject o) { + LDKVerification *res_ptr = MALLOC(sizeof(LDKVerification), "LDKVerification"); + *res_ptr = LDKVerification_init(env, clz, o); + return tag_ptr(res_ptr, true); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Verification_1hmac_1for_1offer_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t nonce, int64_t expanded_key) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKVerification* this_arg_conv = (LDKVerification*)this_arg_ptr; + 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 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; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->hmac_for_offer_payment)(this_arg_conv->this_arg, nonce_conv, &expanded_key_conv).data); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Verification_1verify_1for_1offer_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray hmac, int64_t nonce, int64_t expanded_key) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKVerification* this_arg_conv = (LDKVerification*)this_arg_ptr; + LDKThirtyTwoBytes hmac_ref; + CHECK((*env)->GetArrayLength(env, hmac) == 32); + (*env)->GetByteArrayRegion(env, hmac, 0, 32, hmac_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 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = (this_arg_conv->verify_for_offer_payment)(this_arg_conv->this_arg, hmac_ref, nonce_conv, &expanded_key_conv); + return tag_ptr(ret_conv, true); +} + static jclass LDKFailureCode_TemporaryNodeFailure_class = NULL; static jmethodID LDKFailureCode_TemporaryNodeFailure_meth = NULL; static jclass LDKFailureCode_RequiredNodeFeatureMissing_class = NULL; @@ -20045,6 +20737,42 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFailureCode_1ref_1from_1 default: abort(); } } +static jclass LDKBolt11InvoiceDescription_Direct_class = NULL; +static jmethodID LDKBolt11InvoiceDescription_Direct_meth = NULL; +static jclass LDKBolt11InvoiceDescription_Hash_class = NULL; +static jmethodID LDKBolt11InvoiceDescription_Hash_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBolt11InvoiceDescription_init (JNIEnv *env, jclass clz) { + LDKBolt11InvoiceDescription_Direct_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11InvoiceDescription$Direct")); + CHECK(LDKBolt11InvoiceDescription_Direct_class != NULL); + LDKBolt11InvoiceDescription_Direct_meth = (*env)->GetMethodID(env, LDKBolt11InvoiceDescription_Direct_class, "", "(J)V"); + CHECK(LDKBolt11InvoiceDescription_Direct_meth != NULL); + LDKBolt11InvoiceDescription_Hash_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11InvoiceDescription$Hash")); + CHECK(LDKBolt11InvoiceDescription_Hash_class != NULL); + LDKBolt11InvoiceDescription_Hash_meth = (*env)->GetMethodID(env, LDKBolt11InvoiceDescription_Hash_class, "", "(J)V"); + CHECK(LDKBolt11InvoiceDescription_Hash_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBolt11InvoiceDescription_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKBolt11InvoiceDescription *obj = (LDKBolt11InvoiceDescription*)untag_ptr(ptr); + switch(obj->tag) { + case LDKBolt11InvoiceDescription_Direct: { + LDKDescription direct_var = obj->direct; + int64_t direct_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(direct_var); + direct_ref = tag_ptr(direct_var.inner, false); + return (*env)->NewObject(env, LDKBolt11InvoiceDescription_Direct_class, LDKBolt11InvoiceDescription_Direct_meth, direct_ref); + } + case LDKBolt11InvoiceDescription_Hash: { + LDKSha256 hash_var = obj->hash; + int64_t hash_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(hash_var); + hash_ref = tag_ptr(hash_var.inner, false); + return (*env)->NewObject(env, LDKBolt11InvoiceDescription_Hash_class, LDKBolt11InvoiceDescription_Hash_meth, hash_ref); + } + default: abort(); + } +} typedef struct LDKMessageSendEventsProvider_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -20190,6 +20918,7 @@ typedef struct LDKChannelMessageHandler_JCalls { jmethodID provided_node_features_meth; jmethodID provided_init_features_meth; jmethodID get_chain_hashes_meth; + jmethodID message_received_meth; } LDKChannelMessageHandler_JCalls; static void LDKChannelMessageHandler_JCalls_free(void* this_arg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -21150,6 +21879,26 @@ LDKCOption_CVec_ThirtyTwoBytesZZ get_chain_hashes_LDKChannelMessageHandler_jcall } return ret_conv; } +void message_received_LDKChannelMessageHandler_jcall(const void* this_arg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_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); + (*env)->CallVoidMethod(env, obj, j_calls->message_received_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to message_received in LDKChannelMessageHandler from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} static void LDKChannelMessageHandler_JCalls_cloned(LDKChannelMessageHandler* new_obj) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) new_obj->this_arg; atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); @@ -21232,6 +21981,8 @@ static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv *en CHECK(calls->provided_init_features_meth != NULL); calls->get_chain_hashes_meth = (*env)->GetMethodID(env, c, "get_chain_hashes", "()J"); CHECK(calls->get_chain_hashes_meth != NULL); + calls->message_received_meth = (*env)->GetMethodID(env, c, "message_received", "()V"); + CHECK(calls->message_received_meth != NULL); LDKChannelMessageHandler ret = { .this_arg = (void*) calls, @@ -21270,6 +22021,7 @@ static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv *en .provided_node_features = provided_node_features_LDKChannelMessageHandler_jcall, .provided_init_features = provided_init_features_LDKChannelMessageHandler_jcall, .get_chain_hashes = get_chain_hashes_LDKChannelMessageHandler_jcall, + .message_received = message_received_LDKChannelMessageHandler_jcall, .free = LDKChannelMessageHandler_JCalls_free, .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, clz, MessageSendEventsProvider), }; @@ -21797,6 +22549,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1get_ return ret_ref; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1message_1received(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); } + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; + (this_arg_conv->message_received)(this_arg_conv->this_arg); +} + typedef struct LDKOffersMessageHandler_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -21967,8 +22726,8 @@ typedef struct LDKAsyncPaymentsMessageHandler_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; - jmethodID held_htlc_available_meth; - jmethodID release_held_htlc_meth; + jmethodID handle_held_htlc_available_meth; + jmethodID handle_release_held_htlc_meth; jmethodID release_pending_messages_meth; } LDKAsyncPaymentsMessageHandler_JCalls; static void LDKAsyncPaymentsMessageHandler_JCalls_free(void* this_arg) { @@ -21988,7 +22747,7 @@ static void LDKAsyncPaymentsMessageHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ held_htlc_available_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg, LDKHeldHtlcAvailable message, LDKResponder responder) { +LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ handle_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); @@ -22007,10 +22766,10 @@ LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ held_htlc_available_LDKA 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); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_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."); + (*env)->FatalError(env, "A call to handle_held_htlc_available in LDKAsyncPaymentsMessageHandler from rust threw an exception."); } void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); @@ -22021,7 +22780,7 @@ LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ held_htlc_available_LDKA } return ret_conv; } -void release_held_htlc_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg, LDKReleaseHeldHtlc message) { +void handle_release_held_htlc_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg, LDKReleaseHeldHtlc message, LDKAsyncPaymentsContext context) { 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); @@ -22034,12 +22793,15 @@ void release_held_htlc_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg int64_t message_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(message_var); message_ref = tag_ptr(message_var.inner, message_var.is_owned); + LDKAsyncPaymentsContext *context_copy = MALLOC(sizeof(LDKAsyncPaymentsContext), "LDKAsyncPaymentsContext"); + *context_copy = context; + int64_t context_ref = tag_ptr(context_copy, true); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->release_held_htlc_meth, message_ref); + (*env)->CallVoidMethod(env, obj, j_calls->handle_release_held_htlc_meth, message_ref, context_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."); + (*env)->FatalError(env, "A call to handle_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); @@ -22093,17 +22855,17 @@ static inline LDKAsyncPaymentsMessageHandler LDKAsyncPaymentsMessageHandler_init 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->handle_held_htlc_available_meth = (*env)->GetMethodID(env, c, "handle_held_htlc_available", "(JJ)J"); + CHECK(calls->handle_held_htlc_available_meth != NULL); + calls->handle_release_held_htlc_meth = (*env)->GetMethodID(env, c, "handle_release_held_htlc", "(JJ)V"); + CHECK(calls->handle_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, + .handle_held_htlc_available = handle_held_htlc_available_LDKAsyncPaymentsMessageHandler_jcall, + .handle_release_held_htlc = handle_release_held_htlc_LDKAsyncPaymentsMessageHandler_jcall, .release_pending_messages = release_pending_messages_LDKAsyncPaymentsMessageHandler_jcall, .free = LDKAsyncPaymentsMessageHandler_JCalls_free, }; @@ -22114,7 +22876,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKAsyncPaymentsMessageHand *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) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1handle_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; @@ -22129,12 +22891,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler 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); + *ret_copy = (this_arg_conv->handle_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) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1handle_1release_1held_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message, int64_t context) { 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; @@ -22143,7 +22905,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1r 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); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKAsyncPaymentsContext context_conv = *(LDKAsyncPaymentsContext*)(context_ptr); + context_conv = AsyncPaymentsContext_clone((LDKAsyncPaymentsContext*)untag_ptr(context)); + (this_arg_conv->handle_release_held_htlc)(this_arg_conv->this_arg, message_conv, context_conv); } JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1release_1pending_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { @@ -22164,6 +22930,256 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHa return ret_arr; } +typedef struct LDKDNSResolverMessageHandler_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID handle_dnssec_query_meth; + jmethodID handle_dnssec_proof_meth; + jmethodID provided_node_features_meth; + jmethodID release_pending_messages_meth; +} LDKDNSResolverMessageHandler_JCalls; +static void LDKDNSResolverMessageHandler_JCalls_free(void* this_arg) { + LDKDNSResolverMessageHandler_JCalls *j_calls = (LDKDNSResolverMessageHandler_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_DNSResolverMessageResponseInstructionZZ handle_dnssec_query_LDKDNSResolverMessageHandler_jcall(const void* this_arg, LDKDNSSECQuery message, LDKResponder responder) { + LDKDNSResolverMessageHandler_JCalls *j_calls = (LDKDNSResolverMessageHandler_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); + } + LDKDNSSECQuery 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->handle_dnssec_query_meth, message_ref, responder_ref); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to handle_dnssec_query in LDKDNSResolverMessageHandler from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ ret_conv = *(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ*)(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 handle_dnssec_proof_LDKDNSResolverMessageHandler_jcall(const void* this_arg, LDKDNSSECProof message, LDKDNSResolverContext context) { + LDKDNSResolverMessageHandler_JCalls *j_calls = (LDKDNSResolverMessageHandler_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); + } + LDKDNSSECProof 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); + LDKDNSResolverContext context_var = context; + int64_t context_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(context_var); + context_ref = tag_ptr(context_var.inner, context_var.is_owned); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->handle_dnssec_proof_meth, message_ref, context_ref); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to handle_dnssec_proof in LDKDNSResolverMessageHandler from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +LDKNodeFeatures provided_node_features_LDKDNSResolverMessageHandler_jcall(const void* this_arg) { + LDKDNSResolverMessageHandler_JCalls *j_calls = (LDKDNSResolverMessageHandler_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); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_node_features_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to provided_node_features in LDKDNSResolverMessageHandler from rust threw an exception."); + } + LDKNodeFeatures ret_conv; + ret_conv.inner = untag_ptr(ret); + ret_conv.is_owned = ptr_is_owned(ret); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; +} +LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ release_pending_messages_LDKDNSResolverMessageHandler_jcall(const void* this_arg) { + LDKDNSResolverMessageHandler_JCalls *j_calls = (LDKDNSResolverMessageHandler_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 LDKDNSResolverMessageHandler from rust threw an exception."); + } + LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ ret_constr; + ret_constr.datalen = (*env)->GetArrayLength(env, ret); + if (ret_constr.datalen > 0) + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ Elements"); + else + ret_constr.data = NULL; + int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL); + for (size_t b = 0; b < ret_constr.datalen; b++) { + int64_t ret_conv_53 = ret_vals[b]; + void* ret_conv_53_ptr = untag_ptr(ret_conv_53); + CHECK_ACCESS(ret_conv_53_ptr); + LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ ret_conv_53_conv = *(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ*)(ret_conv_53_ptr); + FREE(untag_ptr(ret_conv_53)); + ret_constr.data[b] = ret_conv_53_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 LDKDNSResolverMessageHandler_JCalls_cloned(LDKDNSResolverMessageHandler* new_obj) { + LDKDNSResolverMessageHandler_JCalls *j_calls = (LDKDNSResolverMessageHandler_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKDNSResolverMessageHandler LDKDNSResolverMessageHandler_init (JNIEnv *env, jclass clz, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKDNSResolverMessageHandler_JCalls *calls = MALLOC(sizeof(LDKDNSResolverMessageHandler_JCalls), "LDKDNSResolverMessageHandler_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->handle_dnssec_query_meth = (*env)->GetMethodID(env, c, "handle_dnssec_query", "(JJ)J"); + CHECK(calls->handle_dnssec_query_meth != NULL); + calls->handle_dnssec_proof_meth = (*env)->GetMethodID(env, c, "handle_dnssec_proof", "(JJ)V"); + CHECK(calls->handle_dnssec_proof_meth != NULL); + calls->provided_node_features_meth = (*env)->GetMethodID(env, c, "provided_node_features", "()J"); + CHECK(calls->provided_node_features_meth != NULL); + calls->release_pending_messages_meth = (*env)->GetMethodID(env, c, "release_pending_messages", "()[J"); + CHECK(calls->release_pending_messages_meth != NULL); + + LDKDNSResolverMessageHandler ret = { + .this_arg = (void*) calls, + .handle_dnssec_query = handle_dnssec_query_LDKDNSResolverMessageHandler_jcall, + .handle_dnssec_proof = handle_dnssec_proof_LDKDNSResolverMessageHandler_jcall, + .provided_node_features = provided_node_features_LDKDNSResolverMessageHandler_jcall, + .release_pending_messages = release_pending_messages_LDKDNSResolverMessageHandler_jcall, + .free = LDKDNSResolverMessageHandler_JCalls_free, + }; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKDNSResolverMessageHandler_1new(JNIEnv *env, jclass clz, jobject o) { + LDKDNSResolverMessageHandler *res_ptr = MALLOC(sizeof(LDKDNSResolverMessageHandler), "LDKDNSResolverMessageHandler"); + *res_ptr = LDKDNSResolverMessageHandler_init(env, clz, o); + return tag_ptr(res_ptr, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSResolverMessageHandler_1handle_1dnssec_1query(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); } + LDKDNSResolverMessageHandler* this_arg_conv = (LDKDNSResolverMessageHandler*)this_arg_ptr; + LDKDNSSECQuery 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 = DNSSECQuery_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_DNSResolverMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ), "LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ"); + *ret_copy = (this_arg_conv->handle_dnssec_query)(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_DNSResolverMessageHandler_1handle_1dnssec_1proof(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message, int64_t context) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKDNSResolverMessageHandler* this_arg_conv = (LDKDNSResolverMessageHandler*)this_arg_ptr; + LDKDNSSECProof 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 = DNSSECProof_clone(&message_conv); + LDKDNSResolverContext context_conv; + context_conv.inner = untag_ptr(context); + context_conv.is_owned = ptr_is_owned(context); + CHECK_INNER_FIELD_ACCESS_OR_NULL(context_conv); + context_conv = DNSResolverContext_clone(&context_conv); + (this_arg_conv->handle_dnssec_proof)(this_arg_conv->this_arg, message_conv, context_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSResolverMessageHandler_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); } + LDKDNSResolverMessageHandler* this_arg_conv = (LDKDNSResolverMessageHandler*)this_arg_ptr; + LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg); + int64_t ret_ref = 0; + 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_DNSResolverMessageHandler_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); } + LDKDNSResolverMessageHandler* this_arg_conv = (LDKDNSResolverMessageHandler*)this_arg_ptr; + LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ 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 b = 0; b < ret_var.datalen; b++) { + LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ* ret_conv_53_conv = MALLOC(sizeof(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ), "LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ"); + *ret_conv_53_conv = ret_var.data[b]; + ret_arr_ptr[b] = tag_ptr(ret_conv_53_conv, true); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + typedef struct LDKNodeIdLookUp_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -22283,7 +23299,7 @@ static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) { +LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKNodeAnnouncement * msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -22292,6 +23308,8 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler } 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); LDKNodeAnnouncement msg_var = *msg; int64_t msg_ref = 0; msg_var = NodeAnnouncement_clone(&msg_var); @@ -22299,7 +23317,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_node_announcement_meth, msg_ref); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_node_announcement_meth, their_node_id_arr, msg_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to handle_node_announcement in LDKRoutingMessageHandler from rust threw an exception."); @@ -22313,7 +23331,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler } return ret_conv; } -LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) { +LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelAnnouncement * msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -22322,6 +23340,8 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand } 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); LDKChannelAnnouncement msg_var = *msg; int64_t msg_ref = 0; msg_var = ChannelAnnouncement_clone(&msg_var); @@ -22329,7 +23349,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_announcement_meth, msg_ref); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_announcement_meth, their_node_id_arr, msg_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to handle_channel_announcement in LDKRoutingMessageHandler from rust threw an exception."); @@ -22343,7 +23363,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand } return ret_conv; } -LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) { +LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -22352,6 +23372,8 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc } 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); LDKChannelUpdate msg_var = *msg; int64_t msg_ref = 0; msg_var = ChannelUpdate_clone(&msg_var); @@ -22359,7 +23381,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_update_meth, msg_ref); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_update_meth, their_node_id_arr, msg_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to handle_channel_update in LDKRoutingMessageHandler from rust threw an exception."); @@ -22670,11 +23692,11 @@ static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv *en atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "(J)J"); + calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "([BJ)J"); CHECK(calls->handle_node_announcement_meth != NULL); - calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "(J)J"); + calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "([BJ)J"); CHECK(calls->handle_channel_announcement_meth != NULL); - calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "(J)J"); + calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "([BJ)J"); CHECK(calls->handle_channel_update_meth != NULL); calls->get_next_channel_announcement_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcement", "(J)J"); CHECK(calls->get_next_channel_announcement_meth != NULL); @@ -22727,45 +23749,54 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1g LDKRoutingMessageHandler *inp = (LDKRoutingMessageHandler *)untag_ptr(arg); return tag_ptr(&inp->MessageSendEventsProvider, false); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)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); 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_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv); + *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)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); 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_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv); + *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)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); 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_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv); + *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); return tag_ptr(ret_conv, true); } @@ -24077,55 +25108,6 @@ 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; @@ -25673,349 +26655,918 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RetryDecodeErrorZ_ return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv *env, jclass clz) { - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = CResult_NoneAPIErrorZ_ok(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ThirtyTwoBytesZ_1some(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); + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = COption_ThirtyTwoBytesZ_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_1ThirtyTwoBytesZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = COption_ThirtyTwoBytesZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ThirtyTwoBytesZ_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_ThirtyTwoBytesZ _res_conv = *(LDKCOption_ThirtyTwoBytesZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_ThirtyTwoBytesZ_free(_res_conv); +} + +static inline uint64_t COption_ThirtyTwoBytesZ_clone_ptr(LDKCOption_ThirtyTwoBytesZ *NONNULL_PTR arg) { + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = COption_ThirtyTwoBytesZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ThirtyTwoBytesZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_ThirtyTwoBytesZ* arg_conv = (LDKCOption_ThirtyTwoBytesZ*)untag_ptr(arg); + int64_t ret_conv = COption_ThirtyTwoBytesZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ThirtyTwoBytesZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_ThirtyTwoBytesZ* orig_conv = (LDKCOption_ThirtyTwoBytesZ*)untag_ptr(orig); + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = COption_ThirtyTwoBytesZ_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_1CVec_1u8ZZ_1some(JNIEnv *env, jclass clz, int8_tArray o) { + LDKCVec_u8Z o_ref; + o_ref.datalen = (*env)->GetArrayLength(env, o); + o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, o, 0, o_ref.datalen, o_ref.data); + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = COption_CVec_u8ZZ_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_1CVec_1u8ZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = COption_CVec_u8ZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_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_CVec_u8ZZ _res_conv = *(LDKCOption_CVec_u8ZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_CVec_u8ZZ_free(_res_conv); +} + +static inline uint64_t COption_CVec_u8ZZ_clone_ptr(LDKCOption_CVec_u8ZZ *NONNULL_PTR arg) { + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = COption_CVec_u8ZZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_CVec_u8ZZ* arg_conv = (LDKCOption_CVec_u8ZZ*)untag_ptr(arg); + int64_t ret_conv = COption_CVec_u8ZZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_CVec_u8ZZ* orig_conv = (LDKCOption_CVec_u8ZZ*)untag_ptr(orig); + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = COption_CVec_u8ZZ_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_1RecipientOnionFieldsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKRecipientOnionFields 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 = RecipientOnionFields_clone(&o_conv); + LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); + *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)untag_ptr(e)); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = CResult_NoneAPIErrorZ_err(e_conv); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); + *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RecipientOnionFieldsDecodeErrorZ* o_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_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_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr); + LDKCResult_RecipientOnionFieldsDecodeErrorZ _res_conv = *(LDKCResult_RecipientOnionFieldsDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NoneAPIErrorZ_free(_res_conv); + CResult_RecipientOnionFieldsDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) { - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = CResult_NoneAPIErrorZ_clone(arg); +static inline uint64_t CResult_RecipientOnionFieldsDecodeErrorZ_clone_ptr(LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); + *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RecipientOnionFieldsDecodeErrorZ* arg_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(orig); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_RecipientOnionFieldsDecodeErrorZ* orig_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); + *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +static inline uint64_t C2Tuple_u64CVec_u8ZZ_clone_ptr(LDKC2Tuple_u64CVec_u8ZZ *NONNULL_PTR arg) { + LDKC2Tuple_u64CVec_u8ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); + *ret_conv = C2Tuple_u64CVec_u8ZZ_clone(arg); return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64CVec_1u8ZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_u64CVec_u8ZZ* arg_conv = (LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_u64CVec_u8ZZ_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CResult_1NoneAPIErrorZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_CResult_NoneAPIErrorZZ _res_constr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64CVec_1u8ZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_u64CVec_u8ZZ* orig_conv = (LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(orig); + LDKC2Tuple_u64CVec_u8ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); + *ret_conv = C2Tuple_u64CVec_u8ZZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64CVec_1u8ZZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) { + LDKCVec_u8Z b_ref; + b_ref.datalen = (*env)->GetArrayLength(env, b); + b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data); + LDKC2Tuple_u64CVec_u8ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); + *ret_conv = C2Tuple_u64CVec_u8ZZ_new(a, b_ref); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64CVec_1u8ZZ_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_u64CVec_u8ZZ _res_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_u64CVec_u8ZZ_free(_res_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u64CVec_1u8ZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_u64CVec_u8ZZZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t w = 0; w < _res_constr.datalen; w++) { - int64_t _res_conv_22 = _res_vals[w]; - void* _res_conv_22_ptr = untag_ptr(_res_conv_22); - CHECK_ACCESS(_res_conv_22_ptr); - LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr); - FREE(untag_ptr(_res_conv_22)); - _res_constr.data[w] = _res_conv_22_conv; + for (size_t x = 0; x < _res_constr.datalen; x++) { + int64_t _res_conv_23 = _res_vals[x]; + void* _res_conv_23_ptr = untag_ptr(_res_conv_23); + CHECK_ACCESS(_res_conv_23_ptr); + LDKC2Tuple_u64CVec_u8ZZ _res_conv_23_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(_res_conv_23_ptr); + FREE(untag_ptr(_res_conv_23)); + _res_constr.data[x] = _res_conv_23_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_CResult_NoneAPIErrorZZ_free(_res_constr); + CVec_C2Tuple_u64CVec_u8ZZZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKRecipientOnionFields 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 = RecipientOnionFields_clone(&o_conv); + LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); + *ret_conv = CResult_RecipientOnionFieldsNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); + *ret_conv = CResult_RecipientOnionFieldsNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RecipientOnionFieldsNoneZ* o_conv = (LDKCResult_RecipientOnionFieldsNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_RecipientOnionFieldsNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_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_RecipientOnionFieldsNoneZ _res_conv = *(LDKCResult_RecipientOnionFieldsNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RecipientOnionFieldsNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_RecipientOnionFieldsNoneZ_clone_ptr(LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR arg) { + LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); + *ret_conv = CResult_RecipientOnionFieldsNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RecipientOnionFieldsNoneZ* arg_conv = (LDKCResult_RecipientOnionFieldsNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RecipientOnionFieldsNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_RecipientOnionFieldsNoneZ* orig_conv = (LDKCResult_RecipientOnionFieldsNoneZ*)untag_ptr(orig); + LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); + *ret_conv = CResult_RecipientOnionFieldsNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +static inline uint64_t C2Tuple_DNSResolverMessageResponseInstructionZ_clone_ptr(LDKC2Tuple_DNSResolverMessageResponseInstructionZ *NONNULL_PTR arg) { + LDKC2Tuple_DNSResolverMessageResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSResolverMessageResponseInstructionZ), "LDKC2Tuple_DNSResolverMessageResponseInstructionZ"); + *ret_conv = C2Tuple_DNSResolverMessageResponseInstructionZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageResponseInstructionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_DNSResolverMessageResponseInstructionZ* arg_conv = (LDKC2Tuple_DNSResolverMessageResponseInstructionZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_DNSResolverMessageResponseInstructionZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageResponseInstructionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_DNSResolverMessageResponseInstructionZ* orig_conv = (LDKC2Tuple_DNSResolverMessageResponseInstructionZ*)untag_ptr(orig); + LDKC2Tuple_DNSResolverMessageResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSResolverMessageResponseInstructionZ), "LDKC2Tuple_DNSResolverMessageResponseInstructionZ"); + *ret_conv = C2Tuple_DNSResolverMessageResponseInstructionZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageResponseInstructionZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKDNSResolverMessage a_conv = *(LDKDNSResolverMessage*)(a_ptr); + a_conv = DNSResolverMessage_clone((LDKDNSResolverMessage*)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_DNSResolverMessageResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSResolverMessageResponseInstructionZ), "LDKC2Tuple_DNSResolverMessageResponseInstructionZ"); + *ret_conv = C2Tuple_DNSResolverMessageResponseInstructionZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageResponseInstructionZ_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_DNSResolverMessageResponseInstructionZ _res_conv = *(LDKC2Tuple_DNSResolverMessageResponseInstructionZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_DNSResolverMessageResponseInstructionZ_free(_res_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1DNSResolverMessageResponseInstructionZZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_DNSResolverMessageResponseInstructionZ o_conv = *(LDKC2Tuple_DNSResolverMessageResponseInstructionZ*)(o_ptr); + o_conv = C2Tuple_DNSResolverMessageResponseInstructionZ_clone((LDKC2Tuple_DNSResolverMessageResponseInstructionZ*)untag_ptr(o)); + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ), "LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_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_1DNSResolverMessageResponseInstructionZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ), "LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1DNSResolverMessageResponseInstructionZZ_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_DNSResolverMessageResponseInstructionZZ _res_conv = *(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_free(_res_conv); +} + +static inline uint64_t COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ), "LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_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_1DNSResolverMessageResponseInstructionZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ* arg_conv = (LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1DNSResolverMessageResponseInstructionZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ* orig_conv = (LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ), "LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline uint64_t C2Tuple_DNSResolverMessageMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ *NONNULL_PTR arg) { + LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ), "LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_DNSResolverMessageMessageSendInstructionsZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageMessageSendInstructionsZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ* arg_conv = (LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_DNSResolverMessageMessageSendInstructionsZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageMessageSendInstructionsZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ* orig_conv = (LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ*)untag_ptr(orig); + LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ), "LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_DNSResolverMessageMessageSendInstructionsZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageMessageSendInstructionsZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKDNSResolverMessage a_conv = *(LDKDNSResolverMessage*)(a_ptr); + a_conv = DNSResolverMessage_clone((LDKDNSResolverMessage*)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_DNSResolverMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ), "LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_DNSResolverMessageMessageSendInstructionsZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageMessageSendInstructionsZ_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_DNSResolverMessageMessageSendInstructionsZ _res_conv = *(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_DNSResolverMessageMessageSendInstructionsZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1APIErrorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_APIErrorZ _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1DNSResolverMessageMessageSendInstructionsZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t k = 0; k < _res_constr.datalen; k++) { - int64_t _res_conv_10 = _res_vals[k]; - void* _res_conv_10_ptr = untag_ptr(_res_conv_10); - CHECK_ACCESS(_res_conv_10_ptr); - LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr); - FREE(untag_ptr(_res_conv_10)); - _res_constr.data[k] = _res_conv_10_conv; + for (size_t b = 0; b < _res_constr.datalen; b++) { + int64_t _res_conv_53 = _res_vals[b]; + void* _res_conv_53_ptr = untag_ptr(_res_conv_53); + CHECK_ACCESS(_res_conv_53_ptr); + LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ _res_conv_53_conv = *(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ*)(_res_conv_53_ptr); + FREE(untag_ptr(_res_conv_53)); + _res_constr.data[b] = _res_conv_53_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_APIErrorZ_free(_res_constr); + CVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ThirtyTwoBytesZ_1some(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); - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = COption_ThirtyTwoBytesZ_some(o_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKDNSResolverMessage o_conv = *(LDKDNSResolverMessage*)(o_ptr); + o_conv = DNSResolverMessage_clone((LDKDNSResolverMessage*)untag_ptr(o)); + LDKCResult_DNSResolverMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverMessageDecodeErrorZ), "LDKCResult_DNSResolverMessageDecodeErrorZ"); + *ret_conv = CResult_DNSResolverMessageDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ThirtyTwoBytesZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = COption_ThirtyTwoBytesZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_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_DNSResolverMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverMessageDecodeErrorZ), "LDKCResult_DNSResolverMessageDecodeErrorZ"); + *ret_conv = CResult_DNSResolverMessageDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ThirtyTwoBytesZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_DNSResolverMessageDecodeErrorZ* o_conv = (LDKCResult_DNSResolverMessageDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_DNSResolverMessageDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_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_ThirtyTwoBytesZ _res_conv = *(LDKCOption_ThirtyTwoBytesZ*)(_res_ptr); + LDKCResult_DNSResolverMessageDecodeErrorZ _res_conv = *(LDKCResult_DNSResolverMessageDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_ThirtyTwoBytesZ_free(_res_conv); + CResult_DNSResolverMessageDecodeErrorZ_free(_res_conv); } -static inline uint64_t COption_ThirtyTwoBytesZ_clone_ptr(LDKCOption_ThirtyTwoBytesZ *NONNULL_PTR arg) { - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = COption_ThirtyTwoBytesZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +static inline uint64_t CResult_DNSResolverMessageDecodeErrorZ_clone_ptr(LDKCResult_DNSResolverMessageDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DNSResolverMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverMessageDecodeErrorZ), "LDKCResult_DNSResolverMessageDecodeErrorZ"); + *ret_conv = CResult_DNSResolverMessageDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ThirtyTwoBytesZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_ThirtyTwoBytesZ* arg_conv = (LDKCOption_ThirtyTwoBytesZ*)untag_ptr(arg); - int64_t ret_conv = COption_ThirtyTwoBytesZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_DNSResolverMessageDecodeErrorZ* arg_conv = (LDKCResult_DNSResolverMessageDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_DNSResolverMessageDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ThirtyTwoBytesZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_ThirtyTwoBytesZ* orig_conv = (LDKCOption_ThirtyTwoBytesZ*)untag_ptr(orig); - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = COption_ThirtyTwoBytesZ_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_1DNSResolverMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_DNSResolverMessageDecodeErrorZ* orig_conv = (LDKCResult_DNSResolverMessageDecodeErrorZ*)untag_ptr(orig); + LDKCResult_DNSResolverMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverMessageDecodeErrorZ), "LDKCResult_DNSResolverMessageDecodeErrorZ"); + *ret_conv = CResult_DNSResolverMessageDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1some(JNIEnv *env, jclass clz, int8_tArray o) { - LDKCVec_u8Z o_ref; - o_ref.datalen = (*env)->GetArrayLength(env, o); - o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, o, 0, o_ref.datalen, o_ref.data); - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = COption_CVec_u8ZZ_some(o_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKHumanReadableName 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 = HumanReadableName_clone(&o_conv); + LDKCResult_HumanReadableNameNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameNoneZ), "LDKCResult_HumanReadableNameNoneZ"); + *ret_conv = CResult_HumanReadableNameNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = COption_CVec_u8ZZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_HumanReadableNameNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameNoneZ), "LDKCResult_HumanReadableNameNoneZ"); + *ret_conv = CResult_HumanReadableNameNoneZ_err(); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HumanReadableNameNoneZ* o_conv = (LDKCResult_HumanReadableNameNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_HumanReadableNameNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_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_CVec_u8ZZ _res_conv = *(LDKCOption_CVec_u8ZZ*)(_res_ptr); + LDKCResult_HumanReadableNameNoneZ _res_conv = *(LDKCResult_HumanReadableNameNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_CVec_u8ZZ_free(_res_conv); + CResult_HumanReadableNameNoneZ_free(_res_conv); } -static inline uint64_t COption_CVec_u8ZZ_clone_ptr(LDKCOption_CVec_u8ZZ *NONNULL_PTR arg) { - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = COption_CVec_u8ZZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +static inline uint64_t CResult_HumanReadableNameNoneZ_clone_ptr(LDKCResult_HumanReadableNameNoneZ *NONNULL_PTR arg) { + LDKCResult_HumanReadableNameNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameNoneZ), "LDKCResult_HumanReadableNameNoneZ"); + *ret_conv = CResult_HumanReadableNameNoneZ_clone(arg); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_CVec_u8ZZ* arg_conv = (LDKCOption_CVec_u8ZZ*)untag_ptr(arg); - int64_t ret_conv = COption_CVec_u8ZZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HumanReadableNameNoneZ* arg_conv = (LDKCResult_HumanReadableNameNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HumanReadableNameNoneZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_CVec_u8ZZ* orig_conv = (LDKCOption_CVec_u8ZZ*)untag_ptr(orig); - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = COption_CVec_u8ZZ_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_1HumanReadableNameNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_HumanReadableNameNoneZ* orig_conv = (LDKCResult_HumanReadableNameNoneZ*)untag_ptr(orig); + LDKCResult_HumanReadableNameNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameNoneZ), "LDKCResult_HumanReadableNameNoneZ"); + *ret_conv = CResult_HumanReadableNameNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKRecipientOnionFields o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKHumanReadableName 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 = RecipientOnionFields_clone(&o_conv); - LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); - *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_ok(o_conv); + o_conv = HumanReadableName_clone(&o_conv); + LDKCResult_HumanReadableNameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameDecodeErrorZ), "LDKCResult_HumanReadableNameDecodeErrorZ"); + *ret_conv = CResult_HumanReadableNameDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_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_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); - *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_err(e_conv); + LDKCResult_HumanReadableNameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameDecodeErrorZ), "LDKCResult_HumanReadableNameDecodeErrorZ"); + *ret_conv = CResult_HumanReadableNameDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_RecipientOnionFieldsDecodeErrorZ* o_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HumanReadableNameDecodeErrorZ* o_conv = (LDKCResult_HumanReadableNameDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HumanReadableNameDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_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_RecipientOnionFieldsDecodeErrorZ _res_conv = *(LDKCResult_RecipientOnionFieldsDecodeErrorZ*)(_res_ptr); + LDKCResult_HumanReadableNameDecodeErrorZ _res_conv = *(LDKCResult_HumanReadableNameDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_RecipientOnionFieldsDecodeErrorZ_free(_res_conv); + CResult_HumanReadableNameDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_RecipientOnionFieldsDecodeErrorZ_clone_ptr(LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); - *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_clone(arg); +static inline uint64_t CResult_HumanReadableNameDecodeErrorZ_clone_ptr(LDKCResult_HumanReadableNameDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HumanReadableNameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameDecodeErrorZ), "LDKCResult_HumanReadableNameDecodeErrorZ"); + *ret_conv = CResult_HumanReadableNameDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_RecipientOnionFieldsDecodeErrorZ* arg_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HumanReadableNameDecodeErrorZ* arg_conv = (LDKCResult_HumanReadableNameDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HumanReadableNameDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_RecipientOnionFieldsDecodeErrorZ* orig_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(orig); - LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); - *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_HumanReadableNameDecodeErrorZ* orig_conv = (LDKCResult_HumanReadableNameDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HumanReadableNameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameDecodeErrorZ), "LDKCResult_HumanReadableNameDecodeErrorZ"); + *ret_conv = CResult_HumanReadableNameDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -static inline uint64_t C2Tuple_u64CVec_u8ZZ_clone_ptr(LDKC2Tuple_u64CVec_u8ZZ *NONNULL_PTR arg) { - LDKC2Tuple_u64CVec_u8ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); - *ret_conv = C2Tuple_u64CVec_u8ZZ_clone(arg); +static inline uint64_t C2Tuple_DNSSECQueryDNSResolverContextZ_clone_ptr(LDKC2Tuple_DNSSECQueryDNSResolverContextZ *NONNULL_PTR arg) { + LDKC2Tuple_DNSSECQueryDNSResolverContextZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSSECQueryDNSResolverContextZ), "LDKC2Tuple_DNSSECQueryDNSResolverContextZ"); + *ret_conv = C2Tuple_DNSSECQueryDNSResolverContextZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64CVec_1u8ZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_u64CVec_u8ZZ* arg_conv = (LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_u64CVec_u8ZZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSSECQueryDNSResolverContextZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_DNSSECQueryDNSResolverContextZ* arg_conv = (LDKC2Tuple_DNSSECQueryDNSResolverContextZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_DNSSECQueryDNSResolverContextZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64CVec_1u8ZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_u64CVec_u8ZZ* orig_conv = (LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(orig); - LDKC2Tuple_u64CVec_u8ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); - *ret_conv = C2Tuple_u64CVec_u8ZZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSSECQueryDNSResolverContextZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_DNSSECQueryDNSResolverContextZ* orig_conv = (LDKC2Tuple_DNSSECQueryDNSResolverContextZ*)untag_ptr(orig); + LDKC2Tuple_DNSSECQueryDNSResolverContextZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSSECQueryDNSResolverContextZ), "LDKC2Tuple_DNSSECQueryDNSResolverContextZ"); + *ret_conv = C2Tuple_DNSSECQueryDNSResolverContextZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64CVec_1u8ZZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) { - LDKCVec_u8Z b_ref; - b_ref.datalen = (*env)->GetArrayLength(env, b); - b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data); - LDKC2Tuple_u64CVec_u8ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); - *ret_conv = C2Tuple_u64CVec_u8ZZ_new(a, b_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSSECQueryDNSResolverContextZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKDNSSECQuery 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 = DNSSECQuery_clone(&a_conv); + LDKDNSResolverContext 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 = DNSResolverContext_clone(&b_conv); + LDKC2Tuple_DNSSECQueryDNSResolverContextZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSSECQueryDNSResolverContextZ), "LDKC2Tuple_DNSSECQueryDNSResolverContextZ"); + *ret_conv = C2Tuple_DNSSECQueryDNSResolverContextZ_new(a_conv, b_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64CVec_1u8ZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSSECQueryDNSResolverContextZ_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_u64CVec_u8ZZ _res_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(_res_ptr); + LDKC2Tuple_DNSSECQueryDNSResolverContextZ _res_conv = *(LDKC2Tuple_DNSSECQueryDNSResolverContextZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_u64CVec_u8ZZ_free(_res_conv); + C2Tuple_DNSSECQueryDNSResolverContextZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u64CVec_1u8ZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_u64CVec_u8ZZZ _res_constr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_DNSSECQueryDNSResolverContextZ o_conv = *(LDKC2Tuple_DNSSECQueryDNSResolverContextZ*)(o_ptr); + o_conv = C2Tuple_DNSSECQueryDNSResolverContextZ_clone((LDKC2Tuple_DNSSECQueryDNSResolverContextZ*)untag_ptr(o)); + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ), "LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ"); + *ret_conv = CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ), "LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ"); + *ret_conv = CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* o_conv = (LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_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_DNSSECQueryDNSResolverContextZNoneZ _res_conv = *(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_clone_ptr(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ), "LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ"); + *ret_conv = CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* arg_conv = (LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* orig_conv = (LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ*)untag_ptr(orig); + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ), "LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ"); + *ret_conv = CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +static inline uint64_t C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone_ptr(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ *NONNULL_PTR arg) { + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ), "LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ"); + *ret_conv = C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HumanReadableNameThirtyTwoBytesZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ* arg_conv = (LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HumanReadableNameThirtyTwoBytesZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ* orig_conv = (LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)untag_ptr(orig); + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ), "LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ"); + *ret_conv = C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HumanReadableNameThirtyTwoBytesZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) { + LDKHumanReadableName 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 = HumanReadableName_clone(&a_conv); + LDKThirtyTwoBytes b_ref; + CHECK((*env)->GetArrayLength(env, b) == 32); + (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data); + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ), "LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ"); + *ret_conv = C2Tuple_HumanReadableNameThirtyTwoBytesZ_new(a_conv, b_ref); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HumanReadableNameThirtyTwoBytesZ_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_HumanReadableNameThirtyTwoBytesZ _res_conv = *(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_HumanReadableNameThirtyTwoBytesZ_free(_res_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ), "LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ 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_23 = _res_vals[x]; - void* _res_conv_23_ptr = untag_ptr(_res_conv_23); - CHECK_ACCESS(_res_conv_23_ptr); - LDKC2Tuple_u64CVec_u8ZZ _res_conv_23_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(_res_conv_23_ptr); - FREE(untag_ptr(_res_conv_23)); - _res_constr.data[x] = _res_conv_23_conv; + for (size_t r = 0; r < _res_constr.datalen; r++) { + int64_t _res_conv_43 = _res_vals[r]; + void* _res_conv_43_ptr = untag_ptr(_res_conv_43); + CHECK_ACCESS(_res_conv_43_ptr); + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ _res_conv_43_conv = *(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)(_res_conv_43_ptr); + FREE(untag_ptr(_res_conv_43)); + _res_constr.data[r] = _res_conv_43_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_u64CVec_u8ZZZ_free(_res_constr); + CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKRecipientOnionFields 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 = RecipientOnionFields_clone(&o_conv); - LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); - *ret_conv = CResult_RecipientOnionFieldsNoneZ_ok(o_conv); +static inline uint64_t C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone_ptr(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ *NONNULL_PTR arg) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ), "LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ"); + *ret_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone(arg); return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ* arg_conv = (LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); - *ret_conv = CResult_RecipientOnionFieldsNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ* orig_conv = (LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ*)untag_ptr(orig); + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ), "LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ"); + *ret_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_RecipientOnionFieldsNoneZ* o_conv = (LDKCResult_RecipientOnionFieldsNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_RecipientOnionFieldsNoneZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZ_1new(JNIEnv *env, jclass clz, int64_tArray a, int64_t b) { + LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ a_constr; + a_constr.datalen = (*env)->GetArrayLength(env, a); + if (a_constr.datalen > 0) + a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ), "LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ Elements"); + else + a_constr.data = NULL; + int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL); + for (size_t r = 0; r < a_constr.datalen; r++) { + int64_t a_conv_43 = a_vals[r]; + void* a_conv_43_ptr = untag_ptr(a_conv_43); + CHECK_ACCESS(a_conv_43_ptr); + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ a_conv_43_conv = *(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)(a_conv_43_ptr); + a_conv_43_conv = C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone((LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)untag_ptr(a_conv_43)); + a_constr.data[r] = a_conv_43_conv; + } + (*env)->ReleaseLongArrayElements(env, a, a_vals, 0); + LDKOffer 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 = Offer_clone(&b_conv); + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ), "LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ"); + *ret_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_new(a_constr, b_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZ_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_RecipientOnionFieldsNoneZ _res_conv = *(LDKCResult_RecipientOnionFieldsNoneZ*)(_res_ptr); + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ _res_conv = *(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_RecipientOnionFieldsNoneZ_free(_res_conv); + C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_free(_res_conv); } -static inline uint64_t CResult_RecipientOnionFieldsNoneZ_clone_ptr(LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR arg) { - LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); - *ret_conv = CResult_RecipientOnionFieldsNoneZ_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ o_conv = *(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ*)(o_ptr); + o_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone((LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ*)untag_ptr(o)); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ"); + *ret_copy = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_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_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ"); + *ret_copy = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ _res_conv = *(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_free(_res_conv); +} + +static inline uint64_t COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_clone_ptr(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ"); + *ret_copy = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_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_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ* arg_conv = (LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ* orig_conv = (LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ"); + *ret_copy = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline uint64_t C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone_ptr(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ *NONNULL_PTR arg) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ), "LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ"); + *ret_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_RecipientOnionFieldsNoneZ* arg_conv = (LDKCResult_RecipientOnionFieldsNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_RecipientOnionFieldsNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ* arg_conv = (LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_RecipientOnionFieldsNoneZ* orig_conv = (LDKCResult_RecipientOnionFieldsNoneZ*)untag_ptr(orig); - LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); - *ret_conv = CResult_RecipientOnionFieldsNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ* orig_conv = (LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ*)untag_ptr(orig); + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ), "LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ"); + *ret_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZ_1new(JNIEnv *env, jclass clz, int64_tArray a, jstring b) { + LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ a_constr; + a_constr.datalen = (*env)->GetArrayLength(env, a); + if (a_constr.datalen > 0) + a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ), "LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ Elements"); + else + a_constr.data = NULL; + int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL); + for (size_t r = 0; r < a_constr.datalen; r++) { + int64_t a_conv_43 = a_vals[r]; + void* a_conv_43_ptr = untag_ptr(a_conv_43); + CHECK_ACCESS(a_conv_43_ptr); + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ a_conv_43_conv = *(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)(a_conv_43_ptr); + a_conv_43_conv = C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone((LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)untag_ptr(a_conv_43)); + a_constr.data[r] = a_conv_43_conv; + } + (*env)->ReleaseLongArrayElements(env, a, a_vals, 0); + LDKStr b_conv = java_to_owned_str(env, b); + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ), "LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ"); + *ret_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_new(a_constr, b_conv); return tag_ptr(ret_conv, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZ_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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ _res_conv = *(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_free(_res_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ o_conv = *(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ*)(o_ptr); + o_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone((LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ*)untag_ptr(o)); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ"); + *ret_copy = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_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_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ"); + *ret_copy = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ _res_conv = *(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_free(_res_conv); +} + +static inline uint64_t COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_clone_ptr(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ"); + *ret_copy = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_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_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ* arg_conv = (LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ* orig_conv = (LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ"); + *ret_copy = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_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_1UnsignedBolt12InvoiceBolt12SemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKUnsignedBolt12Invoice o_conv; o_conv.inner = untag_ptr(o); @@ -26166,6 +27717,26 @@ 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_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(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ 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]; + 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_BlindedPaymentPathZ_free(_res_constr); +} + 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); @@ -27928,26 +29499,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErro return tag_ptr(ret_conv, true); } -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(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ 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]; - 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_BlindedPaymentPathZ_free(_res_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); @@ -28010,155 +29561,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPayme return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { - LDKCVec_PublicKeyZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - _res_constr.data = NULL; - for (size_t i = 0; i < _res_constr.datalen; i++) { - int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i); - LDKPublicKey _res_conv_8_ref; - CHECK((*env)->GetArrayLength(env, _res_conv_8) == 33); - (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 33, _res_conv_8_ref.compressed_form); - _res_constr.data[i] = _res_conv_8_ref; - } - CVec_PublicKeyZ_free(_res_constr); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKOnionMessagePath 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 = OnionMessagePath_clone(&o_conv); - LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); - *ret_conv = CResult_OnionMessagePathNoneZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); - *ret_conv = CResult_OnionMessagePathNoneZ_err(); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_OnionMessagePathNoneZ* o_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_OnionMessagePathNoneZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_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_OnionMessagePathNoneZ _res_conv = *(LDKCResult_OnionMessagePathNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_OnionMessagePathNoneZ_free(_res_conv); -} - -static inline uint64_t CResult_OnionMessagePathNoneZ_clone_ptr(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR arg) { - LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); - *ret_conv = CResult_OnionMessagePathNoneZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_OnionMessagePathNoneZ* arg_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_OnionMessagePathNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_OnionMessagePathNoneZ* orig_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(orig); - LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); - *ret_conv = CResult_OnionMessagePathNoneZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -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(LDKBlindedMessagePath), "LDKCVec_BlindedMessagePathZ Elements"); - else - o_constr.data = NULL; - int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL); - 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_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_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_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_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_BlindedMessagePathZNoneZ _res_conv = *(LDKCResult_CVec_BlindedMessagePathZNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_CVec_BlindedMessagePathZNoneZ_free(_res_conv); -} - -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_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_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); @@ -28687,6 +30089,23 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecode return tag_ptr(ret_conv, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { + LDKCVec_PublicKeyZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); + else + _res_constr.data = NULL; + for (size_t i = 0; i < _res_constr.datalen; i++) { + int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i); + LDKPublicKey _res_conv_8_ref; + CHECK((*env)->GetArrayLength(env, _res_conv_8) == 33); + (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 33, _res_conv_8_ref.compressed_form); + _res_constr.data[i] = _res_conv_8_ref; + } + CVec_PublicKeyZ_free(_res_constr); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKFixedPenaltyScorer o_conv; o_conv.inner = untag_ptr(o); @@ -29310,384 +30729,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C4Tuple_1OutPointChannel CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1ok(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 = InitFeatures_clone(&o_conv); - LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_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_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_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_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_InitFeaturesDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_InitFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_InitFeaturesDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_InitFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1ok(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 = ChannelFeatures_clone(&o_conv); - LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_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_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_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_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ChannelFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ChannelFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1ok(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 = NodeFeatures_clone(&o_conv); - LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_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_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_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_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_NodeFeaturesDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NodeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NodeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1ok(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 = Bolt11InvoiceFeatures_clone(&o_conv); - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_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_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_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_Bolt11InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1ok(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 = Bolt12InvoiceFeatures_clone(&o_conv); - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_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_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_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_Bolt12InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1ok(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 = BlindedHopFeatures_clone(&o_conv); - LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); - *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_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_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); - *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_BlindedHopFeaturesDecodeErrorZ* o_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_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_BlindedHopFeaturesDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopFeaturesDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_BlindedHopFeaturesDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); - *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_BlindedHopFeaturesDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_BlindedHopFeaturesDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); - *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1ok(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 = ChannelTypeFeatures_clone(&o_conv); - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_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_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_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_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferIdDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKOfferId o_conv; o_conv.inner = untag_ptr(o); @@ -29839,72 +30880,38 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferBolt12Semanti return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKInvoiceRequestWithDerivedPayerIdBuilder o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder - LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ"); - *ret_conv = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(o_conv); + LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_java(env, e); - LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ"); - *ret_conv = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(e_conv); + LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_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_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ _res_conv = *(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)(_res_ptr); + LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ _res_conv = *(LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(_res_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKInvoiceRequestWithExplicitPayerIdBuilder o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder - - LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); - *ret_conv = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_java(env, e); - LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); - *ret_conv = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_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_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ _res_conv = *(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(_res_conv); + CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_free(_res_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { @@ -31473,52 +32480,52 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RecentPaymentDetailsZ_1f CVec_RecentPaymentDetailsZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv *env, jclass clz) { - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = CResult_NonePaymentSendFailureZ_ok(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_ok(); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); - e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e)); - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv); + LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); + e_conv = APIError_clone((LDKAPIError*)untag_ptr(e)); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(o); - jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_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_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr); + LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NonePaymentSendFailureZ_free(_res_conv); + CResult_NoneAPIErrorZ_free(_res_conv); } -static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) { - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg); +static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(orig); - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(orig); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -31568,55 +32575,99 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendF return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_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_ThirtyTwoBytesPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ), "LDKCResult_ThirtyTwoBytesPaymentSendFailureZ"); - *ret_conv = CResult_ThirtyTwoBytesPaymentSendFailureZ_ok(o_ref); +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); + 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; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneBolt12PaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12PaymentErrorZ), "LDKCResult_NoneBolt12PaymentErrorZ"); + *ret_conv = CResult_NoneBolt12PaymentErrorZ_ok(); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); - e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e)); - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ), "LDKCResult_ThirtyTwoBytesPaymentSendFailureZ"); - *ret_conv = CResult_ThirtyTwoBytesPaymentSendFailureZ_err(e_conv); + LDKBolt12PaymentError e_conv = *(LDKBolt12PaymentError*)(e_ptr); + e_conv = Bolt12PaymentError_clone((LDKBolt12PaymentError*)untag_ptr(e)); + LDKCResult_NoneBolt12PaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12PaymentErrorZ), "LDKCResult_NoneBolt12PaymentErrorZ"); + *ret_conv = CResult_NoneBolt12PaymentErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* o_conv = (LDKCResult_ThirtyTwoBytesPaymentSendFailureZ*)untag_ptr(o); - jboolean ret_conv = CResult_ThirtyTwoBytesPaymentSendFailureZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneBolt12PaymentErrorZ* o_conv = (LDKCResult_NoneBolt12PaymentErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneBolt12PaymentErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_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_ThirtyTwoBytesPaymentSendFailureZ _res_conv = *(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ*)(_res_ptr); + LDKCResult_NoneBolt12PaymentErrorZ _res_conv = *(LDKCResult_NoneBolt12PaymentErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ThirtyTwoBytesPaymentSendFailureZ_free(_res_conv); + CResult_NoneBolt12PaymentErrorZ_free(_res_conv); } -static inline uint64_t CResult_ThirtyTwoBytesPaymentSendFailureZ_clone_ptr(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR arg) { - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ), "LDKCResult_ThirtyTwoBytesPaymentSendFailureZ"); - *ret_conv = CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(arg); +static inline uint64_t CResult_NoneBolt12PaymentErrorZ_clone_ptr(LDKCResult_NoneBolt12PaymentErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneBolt12PaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12PaymentErrorZ), "LDKCResult_NoneBolt12PaymentErrorZ"); + *ret_conv = CResult_NoneBolt12PaymentErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* arg_conv = (LDKCResult_ThirtyTwoBytesPaymentSendFailureZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ThirtyTwoBytesPaymentSendFailureZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneBolt12PaymentErrorZ* arg_conv = (LDKCResult_NoneBolt12PaymentErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneBolt12PaymentErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* orig_conv = (LDKCResult_ThirtyTwoBytesPaymentSendFailureZ*)untag_ptr(orig); - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ), "LDKCResult_ThirtyTwoBytesPaymentSendFailureZ"); - *ret_conv = CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NoneBolt12PaymentErrorZ* orig_conv = (LDKCResult_NoneBolt12PaymentErrorZ*)untag_ptr(orig); + LDKCResult_NoneBolt12PaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12PaymentErrorZ), "LDKCResult_NoneBolt12PaymentErrorZ"); + *ret_conv = CResult_NoneBolt12PaymentErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -31708,56 +32759,56 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ThirtyTwoBytesThirtyT C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1ok(JNIEnv *env, jclass clz, int64_t o) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1ok(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o_conv = *(LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ*)(o_ptr); o_conv = C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone((LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ*)untag_ptr(o)); - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ"); - *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(o_conv); + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ"); + *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); - e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e)); - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ"); - *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_err(e_conv); + LDKProbeSendFailure e_conv = *(LDKProbeSendFailure*)(e_ptr); + e_conv = ProbeSendFailure_clone((LDKProbeSendFailure*)untag_ptr(e)); + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ"); + *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ*)untag_ptr(o); - jboolean ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* o_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ*)untag_ptr(o); + jboolean ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_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_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ*)(_res_ptr); + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ _res_conv = *(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free(_res_conv); + CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_free(_res_conv); } -static inline uint64_t CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ"); - *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(arg); +static inline uint64_t CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_clone_ptr(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ"); + *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ*)untag_ptr(arg); - int64_t ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* arg_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ*)untag_ptr(arg); + int64_t ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ*)untag_ptr(orig); - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ"); - *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* orig_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ*)untag_ptr(orig); + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ"); + *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -31927,6 +32978,148 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelIdZ_1free(JNIEnv CVec_ChannelIdZ_free(_res_constr); } +static inline uint64_t C2Tuple_PublicKeyChannelIdZ_clone_ptr(LDKC2Tuple_PublicKeyChannelIdZ *NONNULL_PTR arg) { + LDKC2Tuple_PublicKeyChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyChannelIdZ), "LDKC2Tuple_PublicKeyChannelIdZ"); + *ret_conv = C2Tuple_PublicKeyChannelIdZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyChannelIdZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_PublicKeyChannelIdZ* arg_conv = (LDKC2Tuple_PublicKeyChannelIdZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_PublicKeyChannelIdZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyChannelIdZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_PublicKeyChannelIdZ* orig_conv = (LDKC2Tuple_PublicKeyChannelIdZ*)untag_ptr(orig); + LDKC2Tuple_PublicKeyChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyChannelIdZ), "LDKC2Tuple_PublicKeyChannelIdZ"); + *ret_conv = C2Tuple_PublicKeyChannelIdZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyChannelIdZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) { + LDKPublicKey a_ref; + CHECK((*env)->GetArrayLength(env, a) == 33); + (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); + 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 = ChannelId_clone(&b_conv); + LDKC2Tuple_PublicKeyChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyChannelIdZ), "LDKC2Tuple_PublicKeyChannelIdZ"); + *ret_conv = C2Tuple_PublicKeyChannelIdZ_new(a_ref, b_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyChannelIdZ_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_PublicKeyChannelIdZ _res_conv = *(LDKC2Tuple_PublicKeyChannelIdZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_PublicKeyChannelIdZ_free(_res_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1PublicKeyChannelIdZZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_PublicKeyChannelIdZ o_conv = *(LDKC2Tuple_PublicKeyChannelIdZ*)(o_ptr); + o_conv = C2Tuple_PublicKeyChannelIdZ_clone((LDKC2Tuple_PublicKeyChannelIdZ*)untag_ptr(o)); + LDKCOption_C2Tuple_PublicKeyChannelIdZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_PublicKeyChannelIdZZ), "LDKCOption_C2Tuple_PublicKeyChannelIdZZ"); + *ret_copy = COption_C2Tuple_PublicKeyChannelIdZZ_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_1PublicKeyChannelIdZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_PublicKeyChannelIdZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_PublicKeyChannelIdZZ), "LDKCOption_C2Tuple_PublicKeyChannelIdZZ"); + *ret_copy = COption_C2Tuple_PublicKeyChannelIdZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1PublicKeyChannelIdZZ_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_PublicKeyChannelIdZZ _res_conv = *(LDKCOption_C2Tuple_PublicKeyChannelIdZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_C2Tuple_PublicKeyChannelIdZZ_free(_res_conv); +} + +static inline uint64_t COption_C2Tuple_PublicKeyChannelIdZZ_clone_ptr(LDKCOption_C2Tuple_PublicKeyChannelIdZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_PublicKeyChannelIdZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_PublicKeyChannelIdZZ), "LDKCOption_C2Tuple_PublicKeyChannelIdZZ"); + *ret_copy = COption_C2Tuple_PublicKeyChannelIdZZ_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_1PublicKeyChannelIdZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_PublicKeyChannelIdZZ* arg_conv = (LDKCOption_C2Tuple_PublicKeyChannelIdZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_PublicKeyChannelIdZZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1PublicKeyChannelIdZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_C2Tuple_PublicKeyChannelIdZZ* orig_conv = (LDKCOption_C2Tuple_PublicKeyChannelIdZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_PublicKeyChannelIdZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_PublicKeyChannelIdZZ), "LDKCOption_C2Tuple_PublicKeyChannelIdZZ"); + *ret_copy = COption_C2Tuple_PublicKeyChannelIdZZ_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_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_CResult_1OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKOfferWithDerivedMetadataBuilder o_conv; o_conv.inner = untag_ptr(o); @@ -32022,6 +33215,26 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1StrZ_1clone(JNIEnv return ret_ref; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1DestinationZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_DestinationZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKDestination), "LDKCVec_DestinationZ 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]; + void* _res_conv_13_ptr = untag_ptr(_res_conv_13); + CHECK_ACCESS(_res_conv_13_ptr); + LDKDestination _res_conv_13_conv = *(LDKDestination*)(_res_conv_13_ptr); + FREE(untag_ptr(_res_conv_13)); + _res_constr.data[n] = _res_conv_13_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_DestinationZ_free(_res_constr); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -32123,53 +33336,6 @@ 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_1OffersContextZ_1some(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)); - 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); @@ -33647,6 +34813,39 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1ThirtyTwoBytesC CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr); } +static inline uint64_t C2Tuple_boolboolZ_clone_ptr(LDKC2Tuple_boolboolZ *NONNULL_PTR arg) { + LDKC2Tuple_boolboolZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_boolboolZ), "LDKC2Tuple_boolboolZ"); + *ret_conv = C2Tuple_boolboolZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1boolboolZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_boolboolZ* arg_conv = (LDKC2Tuple_boolboolZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_boolboolZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1boolboolZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_boolboolZ* orig_conv = (LDKC2Tuple_boolboolZ*)untag_ptr(orig); + LDKC2Tuple_boolboolZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_boolboolZ), "LDKC2Tuple_boolboolZ"); + *ret_conv = C2Tuple_boolboolZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1boolboolZ_1new(JNIEnv *env, jclass clz, jboolean a, jboolean b) { + LDKC2Tuple_boolboolZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_boolboolZ), "LDKC2Tuple_boolboolZ"); + *ret_conv = C2Tuple_boolboolZ_new(a, b); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1boolboolZ_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_boolboolZ _res_conv = *(LDKC2Tuple_boolboolZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_boolboolZ_free(_res_conv); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BalanceZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { LDKCVec_BalanceZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); @@ -34545,6 +35744,124 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1StrZIOErrorZ return tag_ptr(ret_conv, true); } +static inline uint64_t C3Tuple_StrStrStrZ_clone_ptr(LDKC3Tuple_StrStrStrZ *NONNULL_PTR arg) { + LDKC3Tuple_StrStrStrZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_StrStrStrZ), "LDKC3Tuple_StrStrStrZ"); + *ret_conv = C3Tuple_StrStrStrZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC3Tuple_StrStrStrZ* arg_conv = (LDKC3Tuple_StrStrStrZ*)untag_ptr(arg); + int64_t ret_conv = C3Tuple_StrStrStrZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC3Tuple_StrStrStrZ* orig_conv = (LDKC3Tuple_StrStrStrZ*)untag_ptr(orig); + LDKC3Tuple_StrStrStrZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_StrStrStrZ), "LDKC3Tuple_StrStrStrZ"); + *ret_conv = C3Tuple_StrStrStrZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1new(JNIEnv *env, jclass clz, jstring a, jstring b, jstring c) { + LDKStr a_conv = java_to_owned_str(env, a); + LDKStr b_conv = java_to_owned_str(env, b); + LDKStr c_conv = java_to_owned_str(env, c); + LDKC3Tuple_StrStrStrZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_StrStrStrZ), "LDKC3Tuple_StrStrStrZ"); + *ret_conv = C3Tuple_StrStrStrZ_new(a_conv, b_conv, c_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_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_StrStrStrZ _res_conv = *(LDKC3Tuple_StrStrStrZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C3Tuple_StrStrStrZ_free(_res_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1StrStrStrZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C3Tuple_StrStrStrZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_StrStrStrZ), "LDKCVec_C3Tuple_StrStrStrZZ 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_23 = _res_vals[x]; + void* _res_conv_23_ptr = untag_ptr(_res_conv_23); + CHECK_ACCESS(_res_conv_23_ptr); + LDKC3Tuple_StrStrStrZ _res_conv_23_conv = *(LDKC3Tuple_StrStrStrZ*)(_res_conv_23_ptr); + FREE(untag_ptr(_res_conv_23)); + _res_constr.data[x] = _res_conv_23_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C3Tuple_StrStrStrZZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1ok(JNIEnv *env, jclass clz, int64_tArray o) { + LDKCVec_C3Tuple_StrStrStrZZ o_constr; + o_constr.datalen = (*env)->GetArrayLength(env, o); + if (o_constr.datalen > 0) + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKC3Tuple_StrStrStrZ), "LDKCVec_C3Tuple_StrStrStrZZ Elements"); + else + o_constr.data = NULL; + int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL); + for (size_t x = 0; x < o_constr.datalen; x++) { + int64_t o_conv_23 = o_vals[x]; + void* o_conv_23_ptr = untag_ptr(o_conv_23); + CHECK_ACCESS(o_conv_23_ptr); + LDKC3Tuple_StrStrStrZ o_conv_23_conv = *(LDKC3Tuple_StrStrStrZ*)(o_conv_23_ptr); + o_conv_23_conv = C3Tuple_StrStrStrZ_clone((LDKC3Tuple_StrStrStrZ*)untag_ptr(o_conv_23)); + o_constr.data[x] = o_conv_23_conv; + } + (*env)->ReleaseLongArrayElements(env, o, o_vals, 0); + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ), "LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ"); + *ret_conv = CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_ok(o_constr); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKIOError e_conv = LDKIOError_from_java(env, e); + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ), "LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ"); + *ret_conv = CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* o_conv = (LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_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_C3Tuple_StrStrStrZZIOErrorZ _res_conv = *(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_clone_ptr(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ *NONNULL_PTR arg) { + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ), "LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ"); + *ret_conv = CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* arg_conv = (LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* orig_conv = (LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ*)untag_ptr(orig); + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ), "LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ"); + *ret_conv = CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1ThirtyTwoBytesChannelMonitorZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); @@ -34677,55 +35994,72 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwo return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKUnsignedInvoiceRequest o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1MonitorNameIOErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKMonitorName 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 = UnsignedInvoiceRequest_clone(&o_conv); - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); - *ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(o_conv); + // WARNING: we need a move here but no clone is available for LDKMonitorName + + LDKCResult_MonitorNameIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MonitorNameIOErrorZ), "LDKCResult_MonitorNameIOErrorZ"); + *ret_conv = CResult_MonitorNameIOErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_java(env, e); - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); - *ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1MonitorNameIOErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKIOError e_conv = LDKIOError_from_java(env, e); + LDKCResult_MonitorNameIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MonitorNameIOErrorZ), "LDKCResult_MonitorNameIOErrorZ"); + *ret_conv = CResult_MonitorNameIOErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* o_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1MonitorNameIOErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_MonitorNameIOErrorZ* o_conv = (LDKCResult_MonitorNameIOErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_MonitorNameIOErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1MonitorNameIOErrorZ_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_UnsignedInvoiceRequestBolt12SemanticErrorZ _res_conv = *(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)(_res_ptr); + LDKCResult_MonitorNameIOErrorZ _res_conv = *(LDKCResult_MonitorNameIOErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(_res_conv); + CResult_MonitorNameIOErrorZ_free(_res_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateNameIOErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKUpdateName o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + // WARNING: we need a move here but no clone is available for LDKUpdateName + + LDKCResult_UpdateNameIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateNameIOErrorZ), "LDKCResult_UpdateNameIOErrorZ"); + *ret_conv = CResult_UpdateNameIOErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -static inline uint64_t CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); - *ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateNameIOErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKIOError e_conv = LDKIOError_from_java(env, e); + LDKCResult_UpdateNameIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateNameIOErrorZ), "LDKCResult_UpdateNameIOErrorZ"); + *ret_conv = CResult_UpdateNameIOErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* arg_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateNameIOErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UpdateNameIOErrorZ* o_conv = (LDKCResult_UpdateNameIOErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_UpdateNameIOErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* orig_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(orig); - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); - *ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateNameIOErrorZ_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_UpdateNameIOErrorZ _res_conv = *(LDKCResult_UpdateNameIOErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_UpdateNameIOErrorZ_free(_res_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestBolt12SemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { @@ -34897,6 +36231,60 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceWithDerivedSig CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(_res_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKInvoiceRequest 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 = InvoiceRequest_clone(&o_conv); + LDKCResult_InvoiceRequestDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestDecodeErrorZ), "LDKCResult_InvoiceRequestDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_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_InvoiceRequestDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestDecodeErrorZ), "LDKCResult_InvoiceRequestDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceRequestDecodeErrorZ* o_conv = (LDKCResult_InvoiceRequestDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_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_InvoiceRequestDecodeErrorZ _res_conv = *(LDKCResult_InvoiceRequestDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceRequestDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_InvoiceRequestDecodeErrorZ_clone_ptr(LDKCResult_InvoiceRequestDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceRequestDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestDecodeErrorZ), "LDKCResult_InvoiceRequestDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceRequestDecodeErrorZ* arg_conv = (LDKCResult_InvoiceRequestDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceRequestDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_InvoiceRequestDecodeErrorZ* orig_conv = (LDKCResult_InvoiceRequestDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InvoiceRequestDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestDecodeErrorZ), "LDKCResult_InvoiceRequestDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFieldsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKInvoiceRequestFields o_conv; o_conv.inner = untag_ptr(o); @@ -40507,10 +41895,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixBolt11Pars } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixBolt11ParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKBolt11ParseError e_conv = *(LDKBolt11ParseError*)(e_ptr); - e_conv = Bolt11ParseError_clone((LDKBolt11ParseError*)untag_ptr(e)); + LDKBolt11ParseError 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 = Bolt11ParseError_clone(&e_conv); LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -40615,10 +42004,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawBolt11Inv } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawBolt11InvoiceBolt11ParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKBolt11ParseError e_conv = *(LDKBolt11ParseError*)(e_ptr); - e_conv = Bolt11ParseError_clone((LDKBolt11ParseError*)untag_ptr(e)); + LDKBolt11ParseError 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 = Bolt11ParseError_clone(&e_conv); LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -41398,6 +42788,384 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelIdDecodeErr return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1ok(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 = InitFeatures_clone(&o_conv); + LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_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_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_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_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InitFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InitFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InitFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_InitFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1ok(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 = ChannelFeatures_clone(&o_conv); + LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_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_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_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_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ChannelFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1ok(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 = NodeFeatures_clone(&o_conv); + LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_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_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_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_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NodeFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NodeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1ok(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 = Bolt11InvoiceFeatures_clone(&o_conv); + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_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_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_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_Bolt11InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1ok(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 = Bolt12InvoiceFeatures_clone(&o_conv); + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_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_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_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_Bolt12InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1ok(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 = BlindedHopFeatures_clone(&o_conv); + LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); + *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_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_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); + *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BlindedHopFeaturesDecodeErrorZ* o_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_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_BlindedHopFeaturesDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopFeaturesDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedHopFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); + *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BlindedHopFeaturesDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_BlindedHopFeaturesDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); + *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1ok(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 = ChannelTypeFeatures_clone(&o_conv); + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_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_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_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_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + static inline uint64_t C2Tuple__u832u16Z_clone_ptr(LDKC2Tuple__u832u16Z *NONNULL_PTR arg) { LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); *ret_conv = C2Tuple__u832u16Z_clone(arg); @@ -41719,60 +43487,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentContextDeco return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKUnknownPaymentContext 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 = UnknownPaymentContext_clone(&o_conv); - LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); - *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_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_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); - *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* o_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_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_UnknownPaymentContextDecodeErrorZ _res_conv = *(LDKCResult_UnknownPaymentContextDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_UnknownPaymentContextDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); - *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* arg_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* orig_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(orig); - LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); - *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12OfferContextDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKBolt12OfferContext o_conv; o_conv.inner = untag_ptr(o); @@ -41985,6 +43699,138 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErr return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKOnionMessagePath 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 = OnionMessagePath_clone(&o_conv); + LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); + *ret_conv = CResult_OnionMessagePathNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); + *ret_conv = CResult_OnionMessagePathNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_OnionMessagePathNoneZ* o_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_OnionMessagePathNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_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_OnionMessagePathNoneZ _res_conv = *(LDKCResult_OnionMessagePathNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OnionMessagePathNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_OnionMessagePathNoneZ_clone_ptr(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR arg) { + LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); + *ret_conv = CResult_OnionMessagePathNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_OnionMessagePathNoneZ* arg_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OnionMessagePathNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_OnionMessagePathNoneZ* orig_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(orig); + LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); + *ret_conv = CResult_OnionMessagePathNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +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(LDKBlindedMessagePath), "LDKCVec_BlindedMessagePathZ Elements"); + else + o_constr.data = NULL; + int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL); + 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_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_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_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_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_BlindedMessagePathZNoneZ _res_conv = *(LDKCResult_CVec_BlindedMessagePathZNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_CVec_BlindedMessagePathZNoneZ_free(_res_conv); +} + +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_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_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_COption_1MessageContextZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -42355,60 +44201,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PhantomRouteHintsZ_1free 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_CResult_1InvoiceErrorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKInvoiceError o_conv; o_conv.inner = untag_ptr(o); @@ -43418,6 +45210,113 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecod return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKAsyncPaymentsContext o_conv = *(LDKAsyncPaymentsContext*)(o_ptr); + o_conv = AsyncPaymentsContext_clone((LDKAsyncPaymentsContext*)untag_ptr(o)); + LDKCResult_AsyncPaymentsContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsContextDecodeErrorZ), "LDKCResult_AsyncPaymentsContextDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsContextDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_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_AsyncPaymentsContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsContextDecodeErrorZ), "LDKCResult_AsyncPaymentsContextDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_AsyncPaymentsContextDecodeErrorZ* o_conv = (LDKCResult_AsyncPaymentsContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_AsyncPaymentsContextDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_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_AsyncPaymentsContextDecodeErrorZ _res_conv = *(LDKCResult_AsyncPaymentsContextDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_AsyncPaymentsContextDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_AsyncPaymentsContextDecodeErrorZ_clone_ptr(LDKCResult_AsyncPaymentsContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_AsyncPaymentsContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsContextDecodeErrorZ), "LDKCResult_AsyncPaymentsContextDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsContextDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_AsyncPaymentsContextDecodeErrorZ* arg_conv = (LDKCResult_AsyncPaymentsContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_AsyncPaymentsContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_AsyncPaymentsContextDecodeErrorZ* orig_conv = (LDKCResult_AsyncPaymentsContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_AsyncPaymentsContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsContextDecodeErrorZ), "LDKCResult_AsyncPaymentsContextDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsContextDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKDNSResolverContext 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 = DNSResolverContext_clone(&o_conv); + LDKCResult_DNSResolverContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverContextDecodeErrorZ), "LDKCResult_DNSResolverContextDecodeErrorZ"); + *ret_conv = CResult_DNSResolverContextDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_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_DNSResolverContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverContextDecodeErrorZ), "LDKCResult_DNSResolverContextDecodeErrorZ"); + *ret_conv = CResult_DNSResolverContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_DNSResolverContextDecodeErrorZ* o_conv = (LDKCResult_DNSResolverContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_DNSResolverContextDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_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_DNSResolverContextDecodeErrorZ _res_conv = *(LDKCResult_DNSResolverContextDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_DNSResolverContextDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_DNSResolverContextDecodeErrorZ_clone_ptr(LDKCResult_DNSResolverContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DNSResolverContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverContextDecodeErrorZ), "LDKCResult_DNSResolverContextDecodeErrorZ"); + *ret_conv = CResult_DNSResolverContextDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_DNSResolverContextDecodeErrorZ* arg_conv = (LDKCResult_DNSResolverContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_DNSResolverContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_DNSResolverContextDecodeErrorZ* orig_conv = (LDKCResult_DNSResolverContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_DNSResolverContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverContextDecodeErrorZ), "LDKCResult_DNSResolverContextDecodeErrorZ"); + *ret_conv = CResult_DNSResolverContextDecodeErrorZ_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) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -43939,6 +45838,27 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KVStore_1free(JNIEnv *env, jcl KVStore_free(this_ptr_conv); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MigratableKVStore_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); + LDKMigratableKVStore this_ptr_conv = *(LDKMigratableKVStore*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MigratableKVStore_free(this_ptr_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_migrate_1kv_1store_1data(JNIEnv *env, jclass clz, int64_t source_store, int64_t target_store) { + void* source_store_ptr = untag_ptr(source_store); + if (ptr_is_owned(source_store)) { CHECK_ACCESS(source_store_ptr); } + LDKMigratableKVStore* source_store_conv = (LDKMigratableKVStore*)source_store_ptr; + void* target_store_ptr = untag_ptr(target_store); + if (ptr_is_owned(target_store)) { CHECK_ACCESS(target_store_ptr); } + LDKMigratableKVStore* target_store_conv = (LDKMigratableKVStore*)target_store_ptr; + LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); + *ret_conv = migrate_kv_store_data(source_store_conv, target_store_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persister_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -44078,6 +45998,79 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1a return tag_ptr(ret_ret, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorName_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKMonitorName this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + MonitorName_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorName_1new(JNIEnv *env, jclass clz, jstring name) { + LDKStr name_conv = java_to_owned_str(env, name); + LDKCResult_MonitorNameIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MonitorNameIOErrorZ), "LDKCResult_MonitorNameIOErrorZ"); + *ret_conv = MonitorName_new(name_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_MonitorName_1as_1str(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKMonitorName this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = MonitorName_as_str(&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 void JNICALL Java_org_ldk_impl_bindings_UpdateName_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUpdateName this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + UpdateName_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateName_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateName this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = UpdateName_get_a(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateName_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUpdateName this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + UpdateName_set_a(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateName_1new(JNIEnv *env, jclass clz, jstring name) { + LDKStr name_conv = java_to_owned_str(env, name); + LDKCResult_UpdateNameIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateNameIOErrorZ), "LDKCResult_UpdateNameIOErrorZ"); + *ret_conv = UpdateName_new(name_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_UpdateName_1as_1str(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUpdateName this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = UpdateName_as_str(&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 jclass JNICALL Java_org_ldk_impl_bindings_ShortChannelIdError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKShortChannelIdError* orig_conv = (LDKShortChannelIdError*)untag_ptr(orig); jclass ret_conv = LDKShortChannelIdError_to_java(env, ShortChannelIdError_clone(orig_conv)); @@ -46336,25 +48329,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1inter UserConfig_set_accept_intercept_htlcs(&this_ptr_conv, val); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1mpp_1keysend(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_accept_mpp_keysend(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1mpp_1keysend(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_accept_mpp_keysend(&this_ptr_conv, val); -} - 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); @@ -46374,7 +48348,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1manually_1han 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) { +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 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); @@ -46390,7 +48364,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, manually_handle_bolt12_invoices_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, 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); @@ -47768,7 +49742,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1a return ret_arr; } -JNIEXPORT int64_t 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, int64_t logger) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -47777,8 +49751,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1process_1pe void* handler_ptr = untag_ptr(handler); if (ptr_is_owned(handler)) { CHECK_ACCESS(handler_ptr); } LDKEventHandler* handler_conv = (LDKEventHandler*)handler_ptr; + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); - *ret_conv = ChannelMonitor_process_pending_events(&this_arg_conv, handler_conv); + *ret_conv = ChannelMonitor_process_pending_events(&this_arg_conv, handler_conv, logger_conv); return tag_ptr(ret_conv, true); } @@ -48203,7 +50180,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1s return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1is_1fully_1resolved(JNIEnv *env, jclass clz, int64_t this_arg, int64_t logger) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1check_1and_1update_1full_1resolution_1status(JNIEnv *env, jclass clz, int64_t this_arg, int64_t logger) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -48212,8 +50189,9 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1is_1fully_ void* logger_ptr = untag_ptr(logger); if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - jboolean ret_conv = ChannelMonitor_is_fully_resolved(&this_arg_conv, logger_conv); - return ret_conv; + LDKC2Tuple_boolboolZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_boolboolZ), "LDKC2Tuple_boolboolZ"); + *ret_conv = ChannelMonitor_check_and_update_full_resolution_status(&this_arg_conv, logger_conv); + return tag_ptr(ret_conv, true); } JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1claimable_1balances(JNIEnv *env, jclass clz, int64_t this_arg) { @@ -48547,7 +50525,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InboundHTLCErr_1eq(JNIEnv return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_peel_1payment_1onion(JNIEnv *env, jclass clz, int64_t msg, int64_t node_signer, int64_t logger, int32_t cur_height, jboolean accept_mpp_keysend, jboolean allow_skimmed_fees) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_peel_1payment_1onion(JNIEnv *env, jclass clz, int64_t msg, int64_t node_signer, int64_t logger, int32_t cur_height, jboolean allow_skimmed_fees) { LDKUpdateAddHTLC msg_conv; msg_conv.inner = untag_ptr(msg); msg_conv.is_owned = ptr_is_owned(msg); @@ -48568,7 +50546,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_peel_1payment_1onion(JNIEnv 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); + *ret_conv = peel_payment_onion(&msg_conv, node_signer_conv, logger_conv, cur_height, allow_skimmed_fees); return tag_ptr(ret_conv, true); } @@ -48657,7 +50635,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PendingHTLCRouting_1receive return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PendingHTLCRouting_1receive_1keysend(JNIEnv *env, jclass clz, int64_t payment_data, int8_tArray payment_preimage, int64_t payment_metadata, int32_t incoming_cltv_expiry, int64_tArray custom_tlvs, jboolean requires_blinded_error) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PendingHTLCRouting_1receive_1keysend(JNIEnv *env, jclass clz, int64_t payment_data, int8_tArray payment_preimage, int64_t payment_metadata, int32_t incoming_cltv_expiry, int64_tArray custom_tlvs, jboolean requires_blinded_error, jboolean has_recipient_created_payment_secret) { LDKFinalOnionHopData payment_data_conv; payment_data_conv.inner = untag_ptr(payment_data); payment_data_conv.is_owned = ptr_is_owned(payment_data); @@ -48687,7 +50665,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PendingHTLCRouting_1receive } (*env)->ReleaseLongArrayElements(env, custom_tlvs, custom_tlvs_vals, 0); LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCRouting_receive_keysend(payment_data_conv, payment_preimage_ref, payment_metadata_conv, incoming_cltv_expiry, custom_tlvs_constr, requires_blinded_error); + *ret_copy = PendingHTLCRouting_receive_keysend(payment_data_conv, payment_preimage_ref, payment_metadata_conv, incoming_cltv_expiry, custom_tlvs_constr, requires_blinded_error, has_recipient_created_payment_secret); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -49088,6 +51066,26 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedFailure_1eq(JNIEnv return ret_conv; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Verification_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); + LDKVerification this_ptr_conv = *(LDKVerification*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Verification_free(this_ptr_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1as_1Verification(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnauthenticatedReceiveTlvs this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKVerification* ret_ret = MALLOC(sizeof(LDKVerification), "LDKVerification"); + *ret_ret = UnauthenticatedReceiveTlvs_as_Verification(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FailureCode_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -49491,7 +51489,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone(JN return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv *env, jclass clz, int64_t fee_est, int64_t chain_monitor, int64_t tx_broadcaster, int64_t router, int64_t logger, int64_t entropy_source, int64_t node_signer, int64_t signer_provider, int64_t config, int64_t params, int32_t current_timestamp) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv *env, jclass clz, int64_t fee_est, int64_t chain_monitor, int64_t tx_broadcaster, int64_t router, int64_t message_router, int64_t logger, int64_t entropy_source, int64_t node_signer, int64_t signer_provider, int64_t config, int64_t params, int32_t current_timestamp) { void* fee_est_ptr = untag_ptr(fee_est); CHECK_ACCESS(fee_est_ptr); LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr); @@ -49520,6 +51518,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKRouter_JCalls_cloned(&router_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* logger_ptr = untag_ptr(logger); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -49558,7 +51563,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv params_conv.is_owned = ptr_is_owned(params); CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); params_conv = ChainParameters_clone(¶ms_conv); - LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, entropy_source_conv, node_signer_conv, signer_provider_conv, config_conv, params_conv, current_timestamp); + LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, message_router_conv, logger_conv, entropy_source_conv, node_signer_conv, signer_provider_conv, config_conv, params_conv, current_timestamp); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -49802,33 +51807,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1 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) { - 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; - LDKRoute route_conv; - route_conv.inner = untag_ptr(route); - route_conv.is_owned = ptr_is_owned(route); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - 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); - 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 = RecipientOnionFields_clone(&recipient_onion_conv); - LDKThirtyTwoBytes payment_id_ref; - 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); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t recipient_onion, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -49860,47 +51838,39 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payme return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1abandon_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment_1for_1bolt12_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice, int64_t context) { 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; - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref); + 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; + 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)); + LDKCResult_NoneBolt12PaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12PaymentErrorZ), "LDKCResult_NoneBolt12PaymentErrorZ"); + *ret_conv = ChannelManager_send_payment_for_bolt12_invoice(&this_arg_conv, &invoice_conv, context_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int64_t payment_preimage, int64_t recipient_onion, int8_tArray payment_id) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1abandon_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id) { 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; - LDKRoute route_conv; - 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; - 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)); - 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 = RecipientOnionFields_clone(&recipient_onion_conv); LDKThirtyTwoBytes payment_id_ref; CHECK((*env)->GetArrayLength(env, payment_id) == 32); (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ), "LDKCResult_ThirtyTwoBytesPaymentSendFailureZ"); - *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_conv, recipient_onion_conv, payment_id_ref); - return tag_ptr(ret_conv, true); + ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment_1with_1retry(JNIEnv *env, jclass clz, int64_t this_arg, int64_t payment_preimage, int64_t recipient_onion, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t payment_preimage, int64_t recipient_onion, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -49928,7 +51898,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spont LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); LDKCResult_ThirtyTwoBytesRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesRetryableSendFailureZ), "LDKCResult_ThirtyTwoBytesRetryableSendFailureZ"); - *ret_conv = ChannelManager_send_spontaneous_payment_with_retry(&this_arg_conv, payment_preimage_conv, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv); + *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, payment_preimage_conv, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv); return tag_ptr(ret_conv, true); } @@ -49943,7 +51913,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1probe path_conv.is_owned = ptr_is_owned(path); CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); path_conv = Path_clone(&path_conv); - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ"); + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ"); *ret_conv = ChannelManager_send_probe(&this_arg_conv, path_conv); return tag_ptr(ret_conv, true); } @@ -50301,6 +52271,205 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inb return tag_ptr(ret_conv, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1signer_1unblocked(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_opt) { + 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* channel_opt_ptr = untag_ptr(channel_opt); + CHECK_ACCESS(channel_opt_ptr); + LDKCOption_C2Tuple_PublicKeyChannelIdZZ channel_opt_conv = *(LDKCOption_C2Tuple_PublicKeyChannelIdZZ*)(channel_opt_ptr); + channel_opt_conv = COption_C2Tuple_PublicKeyChannelIdZZ_clone((LDKCOption_C2Tuple_PublicKeyChannelIdZZ*)untag_ptr(channel_opt)); + ChannelManager_signer_unblocked(&this_arg_conv, channel_opt_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1bolt11_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int64_t params) { + 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; + LDKBolt11InvoiceParameters params_conv; + params_conv.inner = untag_ptr(params); + params_conv.is_owned = ptr_is_owned(params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); + // WARNING: we need a move here but no clone is available for LDKBolt11InvoiceParameters + + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = ChannelManager_create_bolt11_invoice(&this_arg_conv, params_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBolt11InvoiceParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt11InvoiceParameters_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1get_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = Bolt11InvoiceParameters_get_amount_msats(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1set_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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)); + Bolt11InvoiceParameters_set_amount_msats(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1get_1description(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBolt11InvoiceDescription *ret_copy = MALLOC(sizeof(LDKBolt11InvoiceDescription), "LDKBolt11InvoiceDescription"); + *ret_copy = Bolt11InvoiceParameters_get_description(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1set_1description(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + LDKBolt11InvoiceDescription val_conv = *(LDKBolt11InvoiceDescription*)(val_ptr); + val_conv = Bolt11InvoiceDescription_clone((LDKBolt11InvoiceDescription*)untag_ptr(val)); + Bolt11InvoiceParameters_set_description(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1get_1invoice_1expiry_1delta_1secs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = Bolt11InvoiceParameters_get_invoice_expiry_delta_secs(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1set_1invoice_1expiry_1delta_1secs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); + Bolt11InvoiceParameters_set_invoice_expiry_delta_secs(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1get_1min_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = Bolt11InvoiceParameters_get_min_final_cltv_expiry_delta(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1set_1min_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); + val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val)); + Bolt11InvoiceParameters_set_min_final_cltv_expiry_delta(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = Bolt11InvoiceParameters_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_Bolt11InvoiceParameters_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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)); + Bolt11InvoiceParameters_set_payment_hash(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1new(JNIEnv *env, jclass clz, int64_t amount_msats_arg, int64_t description_arg, int64_t invoice_expiry_delta_secs_arg, int64_t min_final_cltv_expiry_delta_arg, int64_t payment_hash_arg) { + void* amount_msats_arg_ptr = untag_ptr(amount_msats_arg); + CHECK_ACCESS(amount_msats_arg_ptr); + LDKCOption_u64Z amount_msats_arg_conv = *(LDKCOption_u64Z*)(amount_msats_arg_ptr); + amount_msats_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amount_msats_arg)); + void* description_arg_ptr = untag_ptr(description_arg); + CHECK_ACCESS(description_arg_ptr); + LDKBolt11InvoiceDescription description_arg_conv = *(LDKBolt11InvoiceDescription*)(description_arg_ptr); + description_arg_conv = Bolt11InvoiceDescription_clone((LDKBolt11InvoiceDescription*)untag_ptr(description_arg)); + void* invoice_expiry_delta_secs_arg_ptr = untag_ptr(invoice_expiry_delta_secs_arg); + CHECK_ACCESS(invoice_expiry_delta_secs_arg_ptr); + LDKCOption_u32Z invoice_expiry_delta_secs_arg_conv = *(LDKCOption_u32Z*)(invoice_expiry_delta_secs_arg_ptr); + invoice_expiry_delta_secs_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(invoice_expiry_delta_secs_arg)); + void* min_final_cltv_expiry_delta_arg_ptr = untag_ptr(min_final_cltv_expiry_delta_arg); + CHECK_ACCESS(min_final_cltv_expiry_delta_arg_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_arg_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_arg_ptr); + min_final_cltv_expiry_delta_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta_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)); + LDKBolt11InvoiceParameters ret_var = Bolt11InvoiceParameters_new(amount_msats_arg_conv, description_arg_conv, invoice_expiry_delta_secs_arg_conv, min_final_cltv_expiry_delta_arg_conv, 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); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1default(JNIEnv *env, jclass clz) { + LDKBolt11InvoiceParameters ret_var = Bolt11InvoiceParameters_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_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); @@ -50393,6 +52562,49 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1request_1re return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1pay_1for_1offer_1from_1human_1readable_1name(JNIEnv *env, jclass clz, int64_t this_arg, int64_t name, int64_t amount_msats, int8_tArray payment_id, int64_t retry_strategy, int64_t max_total_routing_fee_msat, int64_tArray dns_resolvers) { + 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; + LDKHumanReadableName name_conv; + name_conv.inner = untag_ptr(name); + name_conv.is_owned = ptr_is_owned(name); + CHECK_INNER_FIELD_ACCESS_OR_NULL(name_conv); + name_conv = HumanReadableName_clone(&name_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + void* retry_strategy_ptr = untag_ptr(retry_strategy); + CHECK_ACCESS(retry_strategy_ptr); + LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); + retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); + void* max_total_routing_fee_msat_ptr = untag_ptr(max_total_routing_fee_msat); + CHECK_ACCESS(max_total_routing_fee_msat_ptr); + LDKCOption_u64Z max_total_routing_fee_msat_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_ptr); + max_total_routing_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat)); + LDKCVec_DestinationZ dns_resolvers_constr; + dns_resolvers_constr.datalen = (*env)->GetArrayLength(env, dns_resolvers); + if (dns_resolvers_constr.datalen > 0) + dns_resolvers_constr.data = MALLOC(dns_resolvers_constr.datalen * sizeof(LDKDestination), "LDKCVec_DestinationZ Elements"); + else + dns_resolvers_constr.data = NULL; + int64_t* dns_resolvers_vals = (*env)->GetLongArrayElements (env, dns_resolvers, NULL); + for (size_t n = 0; n < dns_resolvers_constr.datalen; n++) { + int64_t dns_resolvers_conv_13 = dns_resolvers_vals[n]; + void* dns_resolvers_conv_13_ptr = untag_ptr(dns_resolvers_conv_13); + CHECK_ACCESS(dns_resolvers_conv_13_ptr); + LDKDestination dns_resolvers_conv_13_conv = *(LDKDestination*)(dns_resolvers_conv_13_ptr); + dns_resolvers_conv_13_conv = Destination_clone((LDKDestination*)untag_ptr(dns_resolvers_conv_13)); + dns_resolvers_constr.data[n] = dns_resolvers_conv_13_conv; + } + (*env)->ReleaseLongArrayElements(env, dns_resolvers, dns_resolvers_vals, 0); + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelManager_pay_for_offer_from_human_readable_name(&this_arg_conv, name_conv, amount_msats, payment_id_ref, retry_strategy_conv, max_total_routing_fee_msat_conv, dns_resolvers_constr); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -50662,6 +52874,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1AsyncPa return tag_ptr(ret_ret, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1DNSResolverMessageHandler(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; + LDKDNSResolverMessageHandler* ret_ret = MALLOC(sizeof(LDKDNSResolverMessageHandler), "LDKDNSResolverMessageHandler"); + *ret_ret = ChannelManager_as_DNSResolverMessageHandler(&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); @@ -51003,6 +53226,33 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1r ChannelManagerReadArgs_set_router(&this_ptr_conv, val_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1message_1router(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_message_router(&this_ptr_conv), false); + return ret_ret; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1message_1router(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + LDKMessageRouter val_conv = *(LDKMessageRouter*)(val_ptr); + if (val_conv.free == LDKMessageRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKMessageRouter_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_message_router(&this_ptr_conv, val_conv); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -51057,7 +53307,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1d ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t signer_provider, int64_t fee_estimator, int64_t chain_monitor, int64_t tx_broadcaster, int64_t router, int64_t logger, int64_t default_config, int64_tArray channel_monitors) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t signer_provider, int64_t fee_estimator, int64_t chain_monitor, int64_t tx_broadcaster, int64_t router, int64_t message_router, int64_t logger, int64_t default_config, int64_tArray channel_monitors) { void* entropy_source_ptr = untag_ptr(entropy_source); CHECK_ACCESS(entropy_source_ptr); LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); @@ -51107,6 +53357,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKRouter_JCalls_cloned(&router_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* logger_ptr = untag_ptr(logger); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -51136,7 +53393,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, channel_monitors, channel_monitors_vals, 0); - LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(entropy_source_conv, node_signer_conv, signer_provider_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, default_config_conv, channel_monitors_constr); + LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(entropy_source_conv, node_signer_conv, signer_provider_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, message_router_conv, logger_conv, default_config_conv, channel_monitors_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); @@ -53212,25 +55469,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1feerate_1 ChannelDetails_set_feerate_sat_per_1000_weight(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1balance_1msat(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; - int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1balance_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t 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_balance_msat(&this_ptr_conv, val); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -53656,7 +55894,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_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) { +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 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); @@ -53763,7 +56001,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_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); + 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, 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); @@ -53912,11 +56150,65 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1free(JNIEnv *env, ExpandedKey_free(this_obj_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKExpandedKey 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 = ExpandedKey_hash(&o_conv); + return ret_conv; +} + +static inline uint64_t ExpandedKey_clone_ptr(LDKExpandedKey *NONNULL_PTR arg) { + LDKExpandedKey ret_var = ExpandedKey_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_ExpandedKey_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKExpandedKey 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 = ExpandedKey_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKExpandedKey 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; + LDKExpandedKey ret_var = ExpandedKey_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_ExpandedKey_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKExpandedKey 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; + LDKExpandedKey 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 = ExpandedKey_eq(&a_conv, &b_conv); + return ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1new(JNIEnv *env, jclass clz, int8_tArray key_material) { - uint8_t key_material_arr[32]; + LDKThirtyTwoBytes key_material_ref; CHECK((*env)->GetArrayLength(env, key_material) == 32); - (*env)->GetByteArrayRegion(env, key_material, 0, 32, key_material_arr); - uint8_t (*key_material_ref)[32] = &key_material_arr; + (*env)->GetByteArrayRegion(env, key_material, 0, 32, key_material_ref.data); LDKExpandedKey ret_var = ExpandedKey_new(key_material_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); @@ -64201,6 +66493,21 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FinalOnionHopData_1clone(JN return ret_ref; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_FinalOnionHopData_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKFinalOnionHopData 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; + LDKFinalOnionHopData 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 = FinalOnionHopData_eq(&a_conv, &b_conv); + return ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionPacket_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKOnionPacket this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -65809,6 +68116,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_1DNSResolverMessageHandler(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; + LDKDNSResolverMessageHandler* ret_ret = MALLOC(sizeof(LDKDNSResolverMessageHandler), "LDKDNSResolverMessageHandler"); + *ret_ret = IgnoringMessageHandler_as_DNSResolverMessageHandler(&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); @@ -68965,167 +71283,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1commitment_1transactio 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 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 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 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 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_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 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 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 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_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); @@ -69579,18 +71736,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1read(JNIEnv *env 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 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); @@ -69711,27 +71856,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1w 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) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, 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); @@ -69742,31 +71872,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan 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); + *ret_conv = create_invoice_from_channelmanager(&channelmanager_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) { +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 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); @@ -69781,31 +71896,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan 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); + *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_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) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash_1and_1payment_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t amt_msat, int64_t description_hash, 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); @@ -69815,71 +71915,24 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan 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); + 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_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); + *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_payment_hash(&channelmanager_conv, amt_msat_conv, description_hash_conv, 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_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) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1payment_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t amt_msat, jstring description, 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); @@ -69893,18 +71946,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan 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); + *ret_conv = create_invoice_from_channelmanager_with_payment_hash(&channelmanager_conv, amt_msat_conv, description_conv, 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_payment_1parameters_1from_1zero_1amount_1invoice(JNIEnv *env, jclass clz, int64_t invoice, int64_t amount_msat) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_payment_1parameters_1from_1variable_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); + *ret_conv = payment_parameters_from_variable_amount_invoice(&invoice_conv, amount_msat); return tag_ptr(ret_conv, true); } @@ -70027,137 +72080,6 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1eq(J 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); -} - -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 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 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_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_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_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 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_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 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); @@ -70259,13 +72181,20 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1route_1no return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1sending_1failed(JNIEnv *env, jclass clz, int64_t a) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1parameter_1error(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)); + LDKAPIError a_conv = *(LDKAPIError*)(a_ptr); + a_conv = APIError_clone((LDKAPIError*)untag_ptr(a)); LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); - *ret_copy = ProbeSendFailure_sending_failed(a_conv); + *ret_copy = ProbeSendFailure_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_ProbeSendFailure_1duplicate_1probe(JNIEnv *env, jclass clz) { + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = ProbeSendFailure_duplicate_probe(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -70509,6 +72438,167 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Type_1free(JNIEnv *env, jclass Type_free(this_ptr_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 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 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 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 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_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 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 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 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_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_OfferId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKOfferId this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -71081,14 +73171,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1supported_1quantity( return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1issuer_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); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Offer_issuer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -71158,7 +73248,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1expects_1quantity(J return ret_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) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice(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); @@ -71177,53 +73267,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice_1de 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 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; - 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 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); + LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = Offer_request_invoice(&this_arg_conv, &expanded_key_conv, nonce_conv, payment_id_ref); return tag_ptr(ret_conv, true); } @@ -71635,6 +73680,28 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1clone(JNIEnv return ret_ref; } +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payment_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_BlindedPaymentPathZ ret_var = UnsignedBolt12Invoice_payment_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++) { + 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; +} + 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); @@ -71843,6 +73910,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1supp return ret_ref; } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1issuer_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_issuer_signing_pubkey(&this_arg_conv).compressed_form); + return ret_arr; +} + 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); @@ -71880,14 +73958,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1quan return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_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_payer_id(&this_arg_conv).compressed_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedBolt12Invoice_payer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -71925,6 +74003,28 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1amou return ret_conv; } +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payment_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; + LDKCVec_BlindedPaymentPathZ ret_var = Bolt12Invoice_payment_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++) { + 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; +} + 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); @@ -72133,6 +74233,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1supported_1q return ret_ref; } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1issuer_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_issuer_signing_pubkey(&this_arg_conv).compressed_form); + return ret_arr; +} + 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); @@ -72170,14 +74281,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1quantity(JNI return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_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_payer_id(&this_arg_conv).compressed_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Bolt12Invoice_payer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -72571,140 +74682,87 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1read(JNIEnv * 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; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_obj_conv; this_obj_conv.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); + InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_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; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1build_1and_1sign(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_arg_conv; this_arg_conv.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 + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_build(this_arg_conv); + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_build_and_sign(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; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_arg_conv; this_arg_conv.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 + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder 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); + *ret_conv = InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_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; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg, int64_t amount_msats) { + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_arg_conv; this_arg_conv.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 + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(this_arg_conv, amount_msats); + *ret_conv = InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_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; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_arg_conv; this_arg_conv.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 + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_quantity(this_arg_conv, quantity); + *ret_conv = InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_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; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg, jstring payer_note) { + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_arg_conv; this_arg_conv.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 + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder LDKStr payer_note_conv = java_to_owned_str(env, payer_note); - InvoiceRequestWithExplicitPayerIdBuilder_payer_note(this_arg_conv, payer_note_conv); + InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_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; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1sourced_1from_1human_1readable_1name(JNIEnv *env, jclass clz, int64_t this_arg, int64_t hrn) { + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_arg_conv; this_arg_conv.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 + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder - 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); + LDKHumanReadableName hrn_conv; + hrn_conv.inner = untag_ptr(hrn); + hrn_conv.is_owned = ptr_is_owned(hrn); + CHECK_INNER_FIELD_ACCESS_OR_NULL(hrn_conv); + hrn_conv = HumanReadableName_clone(&hrn_conv); + InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_sourced_from_human_readable_name(this_arg_conv, hrn_conv); } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1free(JNIEnv *env, jclass clz, int64_t this_obj) { @@ -72999,14 +75057,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1sup return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1issuer_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; int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedInvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedInvoiceRequest_issuer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -73045,6 +75103,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1amo return ret_ref; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1has_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 = UnsignedInvoiceRequest_has_amount_msats(&this_arg_conv); + return ret_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); @@ -73070,14 +75138,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1qua return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_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; int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedInvoiceRequest_payer_id(&this_arg_conv).compressed_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedInvoiceRequest_payer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -73094,6 +75162,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1pay return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1offer_1from_1hrn(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; + LDKHumanReadableName ret_var = UnsignedInvoiceRequest_offer_from_hrn(&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 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); @@ -73223,14 +75304,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1supported_1 return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1issuer_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); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, InvoiceRequest_issuer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -73269,6 +75350,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1amount_1msa return ret_ref; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1has_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 = InvoiceRequest_has_amount_msats(&this_arg_conv); + return ret_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); @@ -73294,14 +75385,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1quantity(JN return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_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_payer_id(&this_arg_conv).compressed_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, InvoiceRequest_payer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -73318,6 +75409,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1note return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1offer_1from_1hrn(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; + LDKHumanReadableName ret_var = InvoiceRequest_offer_from_hrn(&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_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); @@ -73557,14 +75661,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1sup return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1issuer_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); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, VerifiedInvoiceRequest_issuer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -73603,6 +75707,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1amo return ret_ref; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1has_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; + jboolean ret_conv = VerifiedInvoiceRequest_has_amount_msats(&this_arg_conv); + return ret_conv; +} + 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); @@ -73628,14 +75742,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1qua return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_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_payer_id(&this_arg_conv).compressed_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, VerifiedInvoiceRequest_payer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -73652,6 +75766,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1pay return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1offer_1from_1hrn(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; + LDKHumanReadableName ret_var = VerifiedInvoiceRequest_offer_from_hrn(&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); @@ -73802,6 +75929,16 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1write(J return ret_arr; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_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_InvoiceRequestDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestDecodeErrorZ), "LDKCResult_InvoiceRequestDecodeErrorZ"); + *ret_conv = InvoiceRequest_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; this_obj_conv.inner = untag_ptr(this_obj); @@ -73810,18 +75947,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1free(JNI InvoiceRequestFields_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) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1payer_1signing_1pubkey(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; 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, InvoiceRequestFields_get_payer_signing_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) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1payer_1signing_1pubkey(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); @@ -73830,7 +75967,7 @@ 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); + InvoiceRequestFields_set_payer_signing_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) { @@ -73885,10 +76022,37 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1pay 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); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1human_1readable_1name(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; + LDKHumanReadableName ret_var = InvoiceRequestFields_get_human_readable_name(&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_1human_1readable_1name(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; + LDKHumanReadableName 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 = HumanReadableName_clone(&val_conv); + InvoiceRequestFields_set_human_readable_name(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1new(JNIEnv *env, jclass clz, int8_tArray payer_signing_pubkey_arg, int64_t quantity_arg, int64_t payer_note_truncated_arg, int64_t human_readable_name_arg) { + LDKPublicKey payer_signing_pubkey_arg_ref; + CHECK((*env)->GetArrayLength(env, payer_signing_pubkey_arg) == 33); + (*env)->GetByteArrayRegion(env, payer_signing_pubkey_arg, 0, 33, payer_signing_pubkey_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); @@ -73898,7 +76062,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1new(J 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); + LDKHumanReadableName human_readable_name_arg_conv; + human_readable_name_arg_conv.inner = untag_ptr(human_readable_name_arg); + human_readable_name_arg_conv.is_owned = ptr_is_owned(human_readable_name_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(human_readable_name_arg_conv); + human_readable_name_arg_conv = HumanReadableName_clone(&human_readable_name_arg_conv); + LDKInvoiceRequestFields ret_var = InvoiceRequestFields_new(payer_signing_pubkey_arg_ref, quantity_arg_conv, payer_note_truncated_arg_conv, human_readable_name_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); @@ -74291,18 +76460,13 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing return ret_conv; } -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()); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1issuer_1signing_1pubkey(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_issuer_signing_pubkey()); return ret_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 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()); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1issuer_1signing_1pubkey(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_issuer_signing_pubkey()); return ret_conv; } @@ -74336,8 +76500,8 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing return ret_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()); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payer_1signing_1pubkey(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_payer_signing_pubkey()); return ret_conv; } @@ -74376,11 +76540,26 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpec return ret_conv; } +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 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 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 jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1human_1readable_1name(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_human_readable_name()); + return ret_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); @@ -74419,20 +76598,20 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetad 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) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1new(JNIEnv *env, jclass clz, int8_tArray metadata, int8_tArray signing_pubkey, 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); + LDKPublicKey signing_pubkey_ref; + CHECK((*env)->GetArrayLength(env, signing_pubkey) == 33); + (*env)->GetByteArrayRegion(env, signing_pubkey, 0, 33, signing_pubkey_ref.compressed_form); LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); - *ret_conv = RefundMaybeWithDerivedMetadataBuilder_new(metadata_ref, payer_id_ref, amount_msats); + *ret_conv = RefundMaybeWithDerivedMetadataBuilder_new(metadata_ref, signing_pubkey_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 nonce, int64_t amount_msats, int8_tArray payment_id) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1deriving_1signing_1pubkey(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); @@ -74450,7 +76629,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetad 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); + *ret_conv = RefundMaybeWithDerivedMetadataBuilder_deriving_signing_pubkey(node_id_ref, &expanded_key_conv, nonce_conv, amount_msats, payment_id_ref); return tag_ptr(ret_conv, true); } @@ -74713,14 +76892,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1quantity(JNIEnv *en return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1signing_1pubkey(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); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Refund_payer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -77161,17 +79340,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router(J return tag_ptr(ret_ret, true); } -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 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); @@ -80279,7 +82447,29 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1histor 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) { +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, jboolean allow_fallback_estimation) { + 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, allow_fallback_estimation); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1live_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); @@ -80296,7 +82486,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1histor 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); + *ret_copy = ProbabilisticScorer_live_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; } @@ -82464,34 +84654,8 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1free(JNIEnv HeldHtlcAvailable_free(this_obj_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; - 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_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; - 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_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); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1new(JNIEnv *env, jclass clz) { + LDKHeldHtlcAvailable ret_var = HeldHtlcAvailable_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); @@ -82536,34 +84700,8 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1free(JNIEnv * 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; - 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 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); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1new(JNIEnv *env, jclass clz) { + LDKReleaseHeldHtlc ret_var = ReleaseHeldHtlc_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); @@ -82688,6 +84826,480 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1read( return tag_ptr(ret_conv, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DNSResolverMessageHandler_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); + LDKDNSResolverMessageHandler this_ptr_conv = *(LDKDNSResolverMessageHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + DNSResolverMessageHandler_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_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); + LDKDNSResolverMessage this_ptr_conv = *(LDKDNSResolverMessage*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + DNSResolverMessage_free(this_ptr_conv); +} + +static inline uint64_t DNSResolverMessage_clone_ptr(LDKDNSResolverMessage *NONNULL_PTR arg) { + LDKDNSResolverMessage *ret_copy = MALLOC(sizeof(LDKDNSResolverMessage), "LDKDNSResolverMessage"); + *ret_copy = DNSResolverMessage_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDNSResolverMessage* arg_conv = (LDKDNSResolverMessage*)untag_ptr(arg); + int64_t ret_conv = DNSResolverMessage_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDNSResolverMessage* orig_conv = (LDKDNSResolverMessage*)untag_ptr(orig); + LDKDNSResolverMessage *ret_copy = MALLOC(sizeof(LDKDNSResolverMessage), "LDKDNSResolverMessage"); + *ret_copy = DNSResolverMessage_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1dnssecquery(JNIEnv *env, jclass clz, int64_t a) { + LDKDNSSECQuery 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 = DNSSECQuery_clone(&a_conv); + LDKDNSResolverMessage *ret_copy = MALLOC(sizeof(LDKDNSResolverMessage), "LDKDNSResolverMessage"); + *ret_copy = DNSResolverMessage_dnssecquery(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1dnssecproof(JNIEnv *env, jclass clz, int64_t a) { + LDKDNSSECProof 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 = DNSSECProof_clone(&a_conv); + LDKDNSResolverMessage *ret_copy = MALLOC(sizeof(LDKDNSResolverMessage), "LDKDNSResolverMessage"); + *ret_copy = DNSResolverMessage_dnssecproof(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKDNSResolverMessage* o_conv = (LDKDNSResolverMessage*)untag_ptr(o); + int64_t ret_conv = DNSResolverMessage_hash(o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKDNSResolverMessage* a_conv = (LDKDNSResolverMessage*)untag_ptr(a); + LDKDNSResolverMessage* b_conv = (LDKDNSResolverMessage*)untag_ptr(b); + jboolean ret_conv = DNSResolverMessage_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DNSSECQuery_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDNSSECQuery this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DNSSECQuery_free(this_obj_conv); +} + +static inline uint64_t DNSSECQuery_clone_ptr(LDKDNSSECQuery *NONNULL_PTR arg) { + LDKDNSSECQuery ret_var = DNSSECQuery_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_DNSSECQuery_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDNSSECQuery 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 = DNSSECQuery_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSSECQuery_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDNSSECQuery 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; + LDKDNSSECQuery ret_var = DNSSECQuery_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_DNSSECQuery_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKDNSSECQuery 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 = DNSSECQuery_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DNSSECQuery_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKDNSSECQuery 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; + LDKDNSSECQuery 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 = DNSSECQuery_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DNSSECProof_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDNSSECProof this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DNSSECProof_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DNSSECProof_1get_1proof(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDNSSECProof this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = DNSSECProof_get_proof(&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_DNSSECProof_1set_1proof(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKDNSSECProof this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + DNSSECProof_set_proof(&this_ptr_conv, val_ref); +} + +static inline uint64_t DNSSECProof_clone_ptr(LDKDNSSECProof *NONNULL_PTR arg) { + LDKDNSSECProof ret_var = DNSSECProof_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_DNSSECProof_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDNSSECProof 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 = DNSSECProof_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSSECProof_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDNSSECProof 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; + LDKDNSSECProof ret_var = DNSSECProof_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_DNSSECProof_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKDNSSECProof 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 = DNSSECProof_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DNSSECProof_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKDNSSECProof 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; + LDKDNSSECProof 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 = DNSSECProof_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1is_1known_1type(JNIEnv *env, jclass clz, int64_t tlv_type) { + jboolean ret_conv = DNSResolverMessage_is_known_type(tlv_type); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKDNSResolverMessage* obj_conv = (LDKDNSResolverMessage*)untag_ptr(obj); + LDKCVec_u8Z ret_var = DNSResolverMessage_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_DNSResolverMessage_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_DNSResolverMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverMessageDecodeErrorZ), "LDKCResult_DNSResolverMessageDecodeErrorZ"); + *ret_conv = DNSResolverMessage_read(ser_ref, arg); + (*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_DNSResolverMessage_1as_1OnionMessageContents(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDNSResolverMessage* this_arg_conv = (LDKDNSResolverMessage*)untag_ptr(this_arg); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = DNSResolverMessage_as_OnionMessageContents(this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKHumanReadableName this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + HumanReadableName_free(this_obj_conv); +} + +static inline uint64_t HumanReadableName_clone_ptr(LDKHumanReadableName *NONNULL_PTR arg) { + LDKHumanReadableName ret_var = HumanReadableName_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_HumanReadableName_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHumanReadableName 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 = HumanReadableName_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKHumanReadableName 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; + LDKHumanReadableName ret_var = HumanReadableName_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_HumanReadableName_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKHumanReadableName 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 = HumanReadableName_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKHumanReadableName 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; + LDKHumanReadableName 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 = HumanReadableName_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1new(JNIEnv *env, jclass clz, jstring user, jstring domain) { + LDKStr user_conv = java_to_owned_str(env, user); + LDKStr domain_conv = java_to_owned_str(env, domain); + LDKCResult_HumanReadableNameNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameNoneZ), "LDKCResult_HumanReadableNameNoneZ"); + *ret_conv = HumanReadableName_new(user_conv, domain_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1from_1encoded(JNIEnv *env, jclass clz, jstring encoded) { + LDKStr encoded_conv = java_to_owned_str(env, encoded); + LDKCResult_HumanReadableNameNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameNoneZ), "LDKCResult_HumanReadableNameNoneZ"); + *ret_conv = HumanReadableName_from_encoded(encoded_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1user(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKHumanReadableName this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = HumanReadableName_user(&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 jstring JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1domain(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKHumanReadableName this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = HumanReadableName_domain(&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 int8_tArray JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKHumanReadableName 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 = HumanReadableName_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_HumanReadableName_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_HumanReadableNameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameDecodeErrorZ), "LDKCResult_HumanReadableNameDecodeErrorZ"); + *ret_conv = HumanReadableName_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_OMNameResolver_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOMNameResolver this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OMNameResolver_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OMNameResolver_1new(JNIEnv *env, jclass clz, int32_t latest_block_time, int32_t latest_block_height) { + LDKOMNameResolver ret_var = OMNameResolver_new(latest_block_time, latest_block_height); + int64_t ret_ref = 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_OMNameResolver_1new_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg, int32_t height, int32_t time) { + LDKOMNameResolver this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + OMNameResolver_new_best_block(&this_arg_conv, height, time); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OMNameResolver_1resolve_1name(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id, int64_t name, int64_t entropy_source) { + LDKOMNameResolver this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKHumanReadableName name_conv; + name_conv.inner = untag_ptr(name); + name_conv.is_owned = ptr_is_owned(name); + CHECK_INNER_FIELD_ACCESS_OR_NULL(name_conv); + name_conv = HumanReadableName_clone(&name_conv); + 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; + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ), "LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ"); + *ret_conv = OMNameResolver_resolve_name(&this_arg_conv, payment_id_ref, name_conv, entropy_source_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OMNameResolver_1handle_1dnssec_1proof_1for_1offer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg, int64_t context) { + LDKOMNameResolver this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKDNSSECProof 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 = DNSSECProof_clone(&msg_conv); + LDKDNSResolverContext context_conv; + context_conv.inner = untag_ptr(context); + context_conv.is_owned = ptr_is_owned(context); + CHECK_INNER_FIELD_ACCESS_OR_NULL(context_conv); + context_conv = DNSResolverContext_clone(&context_conv); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ"); + *ret_copy = OMNameResolver_handle_dnssec_proof_for_offer(&this_arg_conv, msg_conv, context_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OMNameResolver_1handle_1dnssec_1proof_1for_1uri(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg, int64_t context) { + LDKOMNameResolver this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKDNSSECProof 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 = DNSSECProof_clone(&msg_conv); + LDKDNSResolverContext context_conv; + context_conv.inner = untag_ptr(context); + context_conv.is_owned = ptr_is_owned(context); + CHECK_INNER_FIELD_ACCESS_OR_NULL(context_conv); + context_conv = DNSResolverContext_clone(&context_conv); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ"); + *ret_copy = OMNameResolver_handle_dnssec_proof_for_uri(&this_arg_conv, msg_conv, context_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + 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); @@ -82840,6 +85452,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ResponseInstruction_1clone( return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ResponseInstruction_1into_1instructions(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKResponseInstruction this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = ResponseInstruction_clone(&this_arg_conv); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = ResponseInstruction_into_instructions(this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + 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); @@ -83565,7 +86189,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_peel_1onion_1message(JNIEnv 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) { +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 dns_resolver, 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); @@ -83615,6 +86239,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new(JNIEnv // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKAsyncPaymentsMessageHandler_JCalls_cloned(&async_payments_handler_conv); } + void* dns_resolver_ptr = untag_ptr(dns_resolver); + CHECK_ACCESS(dns_resolver_ptr); + LDKDNSResolverMessageHandler dns_resolver_conv = *(LDKDNSResolverMessageHandler*)(dns_resolver_ptr); + if (dns_resolver_conv.free == LDKDNSResolverMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKDNSResolverMessageHandler_JCalls_cloned(&dns_resolver_conv); + } void* custom_handler_ptr = untag_ptr(custom_handler); CHECK_ACCESS(custom_handler_ptr); LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); @@ -83622,14 +86253,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new(JNIEnv // 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); + 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, dns_resolver_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) { +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 dns_resolver, 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); @@ -83679,6 +86310,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new_1with_1 // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKAsyncPaymentsMessageHandler_JCalls_cloned(&async_payments_handler_conv); } + void* dns_resolver_ptr = untag_ptr(dns_resolver); + CHECK_ACCESS(dns_resolver_ptr); + LDKDNSResolverMessageHandler dns_resolver_conv = *(LDKDNSResolverMessageHandler*)(dns_resolver_ptr); + if (dns_resolver_conv.free == LDKDNSResolverMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKDNSResolverMessageHandler_JCalls_cloned(&dns_resolver_conv); + } void* custom_handler_ptr = untag_ptr(custom_handler); CHECK_ACCESS(custom_handler_ptr); LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); @@ -83686,7 +86324,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new_1with_1 // 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); + 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, dns_resolver_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); @@ -84125,6 +86763,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_ return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1dnsresolver(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKDNSResolverMessage a_conv = *(LDKDNSResolverMessage*)(a_ptr); + a_conv = DNSResolverMessage_clone((LDKDNSResolverMessage*)untag_ptr(a)); + LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); + *ret_copy = ParsedOnionMessageContents_dnsresolver(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); @@ -85229,19 +87878,70 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1free(JNIEnv *env, ReceiveTlvs_free(this_obj_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; +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_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 = ReceiveTlvs_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; + 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); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_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_1tlvs(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKReceiveTlvs this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKUnauthenticatedReceiveTlvs ret_var = ReceiveTlvs_tlvs(&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_UnauthenticatedReceiveTlvs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUnauthenticatedReceiveTlvs this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + UnauthenticatedReceiveTlvs_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1get_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnauthenticatedReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnauthenticatedReceiveTlvs_get_payment_secret(&this_ptr_conv)); return ret_arr; } -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; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1set_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnauthenticatedReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -85249,24 +87949,24 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1sec 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); + UnauthenticatedReceiveTlvs_set_payment_secret(&this_ptr_conv, val_ref); } -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; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1get_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnauthenticatedReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); + LDKPaymentConstraints ret_var = UnauthenticatedReceiveTlvs_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; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1set_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUnauthenticatedReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -85276,23 +87976,23 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1con 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); + UnauthenticatedReceiveTlvs_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; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1get_1payment_1context(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnauthenticatedReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); + *ret_copy = UnauthenticatedReceiveTlvs_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_ReceiveTlvs_1set_1payment_1context(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKReceiveTlvs this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1set_1payment_1context(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUnauthenticatedReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -85301,10 +88001,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1con 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); + UnauthenticatedReceiveTlvs_set_payment_context(&this_ptr_conv, val_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) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_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); @@ -85317,37 +88017,60 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1new(JNIEnv *en 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); + LDKUnauthenticatedReceiveTlvs ret_var = UnauthenticatedReceiveTlvs_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 ReceiveTlvs_clone_ptr(LDKReceiveTlvs *NONNULL_PTR arg) { - LDKReceiveTlvs ret_var = ReceiveTlvs_clone(arg); +static inline uint64_t UnauthenticatedReceiveTlvs_clone_ptr(LDKUnauthenticatedReceiveTlvs *NONNULL_PTR arg) { + LDKUnauthenticatedReceiveTlvs ret_var = UnauthenticatedReceiveTlvs_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_UnauthenticatedReceiveTlvs_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnauthenticatedReceiveTlvs 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 = UnauthenticatedReceiveTlvs_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_UnauthenticatedReceiveTlvs_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUnauthenticatedReceiveTlvs 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); + LDKUnauthenticatedReceiveTlvs ret_var = UnauthenticatedReceiveTlvs_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_UnauthenticatedReceiveTlvs_1authenticate(JNIEnv *env, jclass clz, int64_t this_arg, int64_t nonce, int64_t expanded_key) { + LDKUnauthenticatedReceiveTlvs this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = UnauthenticatedReceiveTlvs_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 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; + LDKReceiveTlvs ret_var = UnauthenticatedReceiveTlvs_authenticate(this_arg_conv, nonce_conv, &expanded_key_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -85570,18 +88293,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1clone(JNIEn 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); @@ -85613,59 +88324,6 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentContext_1eq(JNIEnv 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); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_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 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); @@ -85878,6 +88536,19 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1write(JNIE return ret_arr; } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUnauthenticatedReceiveTlvs 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 = UnauthenticatedReceiveTlvs_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_PaymentRelay_1write(JNIEnv *env, jclass clz, int64_t obj) { LDKPaymentRelay obj_conv; obj_conv.inner = untag_ptr(obj); @@ -85943,29 +88614,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1read(JNIEnv return tag_ptr(ret_conv, true); } -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 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 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); @@ -86474,6 +89122,29 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageContext_1offers(JNIE return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageContext_1async_1payments(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKAsyncPaymentsContext a_conv = *(LDKAsyncPaymentsContext*)(a_ptr); + a_conv = AsyncPaymentsContext_clone((LDKAsyncPaymentsContext*)untag_ptr(a)); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_async_payments(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageContext_1dnsresolver(JNIEnv *env, jclass clz, int64_t a) { + LDKDNSResolverContext 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 = DNSResolverContext_clone(&a_conv); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_dnsresolver(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + 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); @@ -86544,12 +89215,20 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1outbound_1pa return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1inbound_1payment(JNIEnv *env, jclass clz, int8_tArray payment_hash) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1inbound_1payment(JNIEnv *env, jclass clz, int8_tArray payment_hash, int64_t nonce, int8_tArray hmac) { LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_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_inbound_payment(payment_hash_ref); + *ret_copy = OffersContext_inbound_payment(payment_hash_ref, nonce_conv, hmac_ref); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -86561,6 +89240,53 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OffersContext_1eq(JNIEnv * return ret_conv; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsContext_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); + LDKAsyncPaymentsContext this_ptr_conv = *(LDKAsyncPaymentsContext*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + AsyncPaymentsContext_free(this_ptr_conv); +} + +static inline uint64_t AsyncPaymentsContext_clone_ptr(LDKAsyncPaymentsContext *NONNULL_PTR arg) { + LDKAsyncPaymentsContext *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsContext), "LDKAsyncPaymentsContext"); + *ret_copy = AsyncPaymentsContext_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAsyncPaymentsContext* arg_conv = (LDKAsyncPaymentsContext*)untag_ptr(arg); + int64_t ret_conv = AsyncPaymentsContext_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKAsyncPaymentsContext* orig_conv = (LDKAsyncPaymentsContext*)untag_ptr(orig); + LDKAsyncPaymentsContext *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsContext), "LDKAsyncPaymentsContext"); + *ret_copy = AsyncPaymentsContext_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsContext_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); + LDKAsyncPaymentsContext *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsContext), "LDKAsyncPaymentsContext"); + *ret_copy = AsyncPaymentsContext_outbound_payment(payment_id_ref, nonce_conv, hmac_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + 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); @@ -86599,6 +89325,145 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1read(JNIEnv return tag_ptr(ret_conv, true); } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsContext_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKAsyncPaymentsContext* obj_conv = (LDKAsyncPaymentsContext*)untag_ptr(obj); + LDKCVec_u8Z ret_var = AsyncPaymentsContext_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_AsyncPaymentsContext_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_AsyncPaymentsContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsContextDecodeErrorZ), "LDKCResult_AsyncPaymentsContextDecodeErrorZ"); + *ret_conv = AsyncPaymentsContext_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_DNSResolverContext_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDNSResolverContext this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DNSResolverContext_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1get_1nonce(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDNSResolverContext this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, *DNSResolverContext_get_nonce(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1set_1nonce(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKDNSResolverContext this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKSixteenBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 16); + (*env)->GetByteArrayRegion(env, val, 0, 16, val_ref.data); + DNSResolverContext_set_nonce(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1new(JNIEnv *env, jclass clz, int8_tArray nonce_arg) { + LDKSixteenBytes nonce_arg_ref; + CHECK((*env)->GetArrayLength(env, nonce_arg) == 16); + (*env)->GetByteArrayRegion(env, nonce_arg, 0, 16, nonce_arg_ref.data); + LDKDNSResolverContext ret_var = DNSResolverContext_new(nonce_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 DNSResolverContext_clone_ptr(LDKDNSResolverContext *NONNULL_PTR arg) { + LDKDNSResolverContext ret_var = DNSResolverContext_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_DNSResolverContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDNSResolverContext 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 = DNSResolverContext_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDNSResolverContext 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; + LDKDNSResolverContext ret_var = DNSResolverContext_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_DNSResolverContext_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKDNSResolverContext 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 = DNSResolverContext_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKDNSResolverContext 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; + LDKDNSResolverContext 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 = DNSResolverContext_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKDNSResolverContext 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 = DNSResolverContext_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_DNSResolverContext_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_DNSResolverContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverContextDecodeErrorZ), "LDKCResult_DNSResolverContextDecodeErrorZ"); + *ret_conv = DNSResolverContext_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_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); @@ -87402,6 +90267,11 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1invoic return ret_conv; } +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1blinded_1path_1creation_1failed(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_blinded_path_creation_failed()); + return ret_conv; +} + 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); @@ -87428,6 +90298,56 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1read( return tag_ptr(ret_conv, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InboundChannelFunds_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); + LDKInboundChannelFunds this_ptr_conv = *(LDKInboundChannelFunds*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + InboundChannelFunds_free(this_ptr_conv); +} + +static inline uint64_t InboundChannelFunds_clone_ptr(LDKInboundChannelFunds *NONNULL_PTR arg) { + LDKInboundChannelFunds *ret_copy = MALLOC(sizeof(LDKInboundChannelFunds), "LDKInboundChannelFunds"); + *ret_copy = InboundChannelFunds_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InboundChannelFunds_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInboundChannelFunds* arg_conv = (LDKInboundChannelFunds*)untag_ptr(arg); + int64_t ret_conv = InboundChannelFunds_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InboundChannelFunds_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInboundChannelFunds* orig_conv = (LDKInboundChannelFunds*)untag_ptr(orig); + LDKInboundChannelFunds *ret_copy = MALLOC(sizeof(LDKInboundChannelFunds), "LDKInboundChannelFunds"); + *ret_copy = InboundChannelFunds_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InboundChannelFunds_1push_1msat(JNIEnv *env, jclass clz, int64_t a) { + LDKInboundChannelFunds *ret_copy = MALLOC(sizeof(LDKInboundChannelFunds), "LDKInboundChannelFunds"); + *ret_copy = InboundChannelFunds_push_msat(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InboundChannelFunds_1dual_1funded(JNIEnv *env, jclass clz) { + LDKInboundChannelFunds *ret_copy = MALLOC(sizeof(LDKInboundChannelFunds), "LDKInboundChannelFunds"); + *ret_copy = InboundChannelFunds_dual_funded(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InboundChannelFunds_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKInboundChannelFunds* a_conv = (LDKInboundChannelFunds*)untag_ptr(a); + LDKInboundChannelFunds* b_conv = (LDKInboundChannelFunds*)untag_ptr(b); + jboolean ret_conv = InboundChannelFunds_eq(a_conv, b_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); @@ -87507,7 +90427,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1funding_1tx_1broadca return ret_ref; } -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) { +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, int64_t payment_id) { 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); @@ -87536,13 +90456,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimable(J 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)); + 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)); 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); + *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, payment_id_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -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) { +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, int64_t payment_id) { 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); @@ -87579,8 +90503,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed(JNI 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* 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)); 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); + *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, payment_id_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -87808,7 +90736,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs(J return ret_ref; } -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) { +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, int8_tArray prev_node_id, int8_tArray next_node_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); @@ -87827,6 +90755,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded(J 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)); + LDKPublicKey prev_node_id_ref; + CHECK((*env)->GetArrayLength(env, prev_node_id) == 33); + (*env)->GetByteArrayRegion(env, prev_node_id, 0, 33, prev_node_id_ref.compressed_form); + LDKPublicKey next_node_id_ref; + CHECK((*env)->GetArrayLength(env, next_node_id) == 33); + (*env)->GetByteArrayRegion(env, next_node_id, 0, 33, next_node_id_ref.compressed_form); 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); @@ -87840,7 +90774,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded(J 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); + *ret_copy = Event_payment_forwarded(prev_channel_id_conv, next_channel_id_conv, prev_user_channel_id_conv, next_user_channel_id_conv, prev_node_id_ref, next_node_id_ref, 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; } @@ -87901,7 +90835,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1ready(JNIEn 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) { +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, int64_t last_local_balance_msat) { LDKChannelId channel_id_conv; channel_id_conv.inner = untag_ptr(channel_id); channel_id_conv.is_owned = ptr_is_owned(channel_id); @@ -87926,8 +90860,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1closed(JNIE 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); + void* last_local_balance_msat_ptr = untag_ptr(last_local_balance_msat); + CHECK_ACCESS(last_local_balance_msat_ptr); + LDKCOption_u64Z last_local_balance_msat_conv = *(LDKCOption_u64Z*)(last_local_balance_msat_ptr); + last_local_balance_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(last_local_balance_msat)); 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); + *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, last_local_balance_msat_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -87948,7 +90886,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1discard_1funding(JNI 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, jboolean is_announced, int64_t params) { +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 channel_negotiation_type, 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); @@ -87957,6 +90895,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1open_1channel_1reque 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_negotiation_type_ptr = untag_ptr(channel_negotiation_type); + CHECK_ACCESS(channel_negotiation_type_ptr); + LDKInboundChannelFunds channel_negotiation_type_conv = *(LDKInboundChannelFunds*)(channel_negotiation_type_ptr); + channel_negotiation_type_conv = InboundChannelFunds_clone((LDKInboundChannelFunds*)untag_ptr(channel_negotiation_type)); LDKChannelTypeFeatures channel_type_conv; channel_type_conv.inner = untag_ptr(channel_type); channel_type_conv.is_owned = ptr_is_owned(channel_type); @@ -87968,7 +90910,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1open_1channel_1reque 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); + *ret_copy = Event_open_channel_request(temporary_channel_id_conv, counterparty_node_id_ref, funding_satoshis, channel_negotiation_type_conv, channel_type_conv, is_announced, params_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -92713,6 +95655,82 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1sh return ret_conv; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1dual_1fund_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_dual_fund_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1dual_1fund_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_dual_fund_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1dual_1fund(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_dual_fund(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1dual_1fund_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_dual_fund_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1dual_1fund_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_dual_fund_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1dual_1fund(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_dual_fund(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1dual_1fund(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_dual_fund(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1dual_1fund(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_dual_fund(&this_arg_conv); + return ret_conv; +} + 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); @@ -93367,6 +96385,34 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1sup return ret_conv; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1trampoline_1routing_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_trampoline_routing_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1trampoline_1routing_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_trampoline_routing_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1supports_1trampoline_1routing(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_trampoline_routing(&this_arg_conv); + return ret_conv; +} + 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); @@ -93397,6 +96443,54 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1req return ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1trampoline_1routing(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_trampoline_routing(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1dns_1resolution_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_dns_resolution_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1dns_1resolution_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_dns_resolution_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1dns_1resolution(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_dns_resolution(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1dns_1resolution(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_dns_resolution(&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; this_obj_conv.inner = untag_ptr(this_obj); @@ -94064,6 +97158,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemStore_1as_1KVStor return tag_ptr(ret_ret, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemStore_1as_1MigratableKVStore(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKFilesystemStore this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKMigratableKVStore* ret_ret = MALLOC(sizeof(LDKMigratableKVStore), "LDKMigratableKVStore"); + *ret_ret = FilesystemStore_as_MigratableKVStore(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKBackgroundProcessor this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -94200,176 +97305,59 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1stop(J return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_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); - LDKBolt11ParseError this_ptr_conv = *(LDKBolt11ParseError*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Bolt11ParseError_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBolt11ParseError this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt11ParseError_free(this_obj_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBolt11ParseError 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; + LDKBolt11ParseError 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 = Bolt11ParseError_eq(&a_conv, &b_conv); + return ret_conv; } static inline uint64_t Bolt11ParseError_clone_ptr(LDKBolt11ParseError *NONNULL_PTR arg) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKBolt11ParseError ret_var = Bolt11ParseError_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_Bolt11ParseError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBolt11ParseError* arg_conv = (LDKBolt11ParseError*)untag_ptr(arg); - int64_t ret_conv = Bolt11ParseError_clone_ptr(arg_conv); + LDKBolt11ParseError 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 = Bolt11ParseError_clone_ptr(&arg_conv); return ret_conv; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBolt11ParseError* orig_conv = (LDKBolt11ParseError*)untag_ptr(orig); - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1bech32_1error(JNIEnv *env, jclass clz, int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKBech32Error a_conv = *(LDKBech32Error*)(a_ptr); - a_conv = Bech32Error_clone((LDKBech32Error*)untag_ptr(a)); - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_bech32_error(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1parse_1amount_1error(JNIEnv *env, jclass clz, int32_t a) { - - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_parse_amount_error((LDKError){ ._dummy = 0 }); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1malformed_1signature(JNIEnv *env, jclass clz, jclass a) { - LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_java(env, a); - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_malformed_signature(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1bad_1prefix(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_bad_prefix(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1unknown_1currency(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_unknown_currency(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1unknown_1si_1prefix(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_unknown_si_prefix(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1malformed_1hrp(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_malformed_hrp(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1too_1short_1data_1part(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_too_short_data_part(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1unexpected_1end_1of_1tagged_1fields(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_unexpected_end_of_tagged_fields(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1description_1decode_1error(JNIEnv *env, jclass clz, int32_t a) { - - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_description_decode_error((LDKError){ ._dummy = 0 }); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1padding_1error(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_padding_error(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1integer_1overflow_1error(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_integer_overflow_error(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1invalid_1seg_1wit_1program_1length(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_invalid_seg_wit_program_length(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1invalid_1pub_1key_1hash_1length(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_invalid_pub_key_hash_length(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1invalid_1script_1hash_1length(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_invalid_script_hash_length(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1invalid_1recovery_1id(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_invalid_recovery_id(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1invalid_1slice_1length(JNIEnv *env, jclass clz, jstring a) { - LDKStr a_conv = java_to_owned_str(env, a); - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_invalid_slice_length(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1skip(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_skip(); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKBolt11ParseError 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; + LDKBolt11ParseError ret_var = Bolt11ParseError_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_Bolt11ParseError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBolt11ParseError* a_conv = (LDKBolt11ParseError*)untag_ptr(a); - LDKBolt11ParseError* b_conv = (LDKBolt11ParseError*)untag_ptr(b); - jboolean ret_conv = Bolt11ParseError_eq(a_conv, b_conv); - return ret_conv; -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -94400,10 +97388,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1clone } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1parse_1error(JNIEnv *env, jclass clz, int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKBolt11ParseError a_conv = *(LDKBolt11ParseError*)(a_ptr); - a_conv = Bolt11ParseError_clone((LDKBolt11ParseError*)untag_ptr(a)); + LDKBolt11ParseError 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 = Bolt11ParseError_clone(&a_conv); LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError"); *ret_copy = ParseOrSemanticError_parse_error(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); @@ -94488,6 +97477,74 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11Invoice_1hash(JNIEnv return ret_conv; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_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); + LDKBolt11InvoiceDescription this_ptr_conv = *(LDKBolt11InvoiceDescription*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Bolt11InvoiceDescription_free(this_ptr_conv); +} + +static inline uint64_t Bolt11InvoiceDescription_clone_ptr(LDKBolt11InvoiceDescription *NONNULL_PTR arg) { + LDKBolt11InvoiceDescription *ret_copy = MALLOC(sizeof(LDKBolt11InvoiceDescription), "LDKBolt11InvoiceDescription"); + *ret_copy = Bolt11InvoiceDescription_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBolt11InvoiceDescription* arg_conv = (LDKBolt11InvoiceDescription*)untag_ptr(arg); + int64_t ret_conv = Bolt11InvoiceDescription_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBolt11InvoiceDescription* orig_conv = (LDKBolt11InvoiceDescription*)untag_ptr(orig); + LDKBolt11InvoiceDescription *ret_copy = MALLOC(sizeof(LDKBolt11InvoiceDescription), "LDKBolt11InvoiceDescription"); + *ret_copy = Bolt11InvoiceDescription_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1direct(JNIEnv *env, jclass clz, int64_t a) { + LDKDescription 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 = Description_clone(&a_conv); + LDKBolt11InvoiceDescription *ret_copy = MALLOC(sizeof(LDKBolt11InvoiceDescription), "LDKBolt11InvoiceDescription"); + *ret_copy = Bolt11InvoiceDescription_direct(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1hash(JNIEnv *env, jclass clz, int64_t a) { + LDKSha256 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 = Sha256_clone(&a_conv); + LDKBolt11InvoiceDescription *ret_copy = MALLOC(sizeof(LDKBolt11InvoiceDescription), "LDKBolt11InvoiceDescription"); + *ret_copy = Bolt11InvoiceDescription_hash(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBolt11InvoiceDescription* a_conv = (LDKBolt11InvoiceDescription*)untag_ptr(a); + LDKBolt11InvoiceDescription* b_conv = (LDKBolt11InvoiceDescription*)untag_ptr(b); + jboolean ret_conv = Bolt11InvoiceDescription_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKBolt11InvoiceDescription* o_conv = (LDKBolt11InvoiceDescription*)untag_ptr(o); + LDKStr ret_str = Bolt11InvoiceDescription_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_SignedRawBolt11Invoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKSignedRawBolt11Invoice this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -96105,6 +99162,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1new(JNIEnv *en return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1empty(JNIEnv *env, jclass clz) { + LDKDescription ret_var = Description_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_Description_1into_1inner(JNIEnv *env, jclass clz, int64_t this_arg) { LDKDescription this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -96406,8 +99471,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawBolt11Invoice_1fro } JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKBolt11ParseError* o_conv = (LDKBolt11ParseError*)untag_ptr(o); - LDKStr ret_str = Bolt11ParseError_to_str(o_conv); + LDKBolt11ParseError 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 = Bolt11ParseError_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; diff --git a/src/main/jni/bindings.c.body b/src/main/jni/bindings.c.body index 5539f5de..38275061 100644 --- a/src/main/jni/bindings.c.body +++ b/src/main/jni/bindings.c.body @@ -423,24 +423,26 @@ static inline LDKBolt12SemanticError LDKBolt12SemanticError_from_java(JNIEnv *en case 8: return LDKBolt12SemanticError_UnknownRequiredFeatures; case 9: return LDKBolt12SemanticError_UnexpectedFeatures; case 10: return LDKBolt12SemanticError_MissingDescription; - case 11: return LDKBolt12SemanticError_MissingSigningPubkey; - case 12: return LDKBolt12SemanticError_InvalidSigningPubkey; - case 13: return LDKBolt12SemanticError_UnexpectedSigningPubkey; - case 14: return LDKBolt12SemanticError_MissingQuantity; - case 15: return LDKBolt12SemanticError_InvalidQuantity; - case 16: return LDKBolt12SemanticError_UnexpectedQuantity; - case 17: return LDKBolt12SemanticError_InvalidMetadata; - case 18: return LDKBolt12SemanticError_UnexpectedMetadata; - case 19: return LDKBolt12SemanticError_MissingPayerMetadata; - case 20: return LDKBolt12SemanticError_MissingPayerId; - case 21: return LDKBolt12SemanticError_DuplicatePaymentId; - case 22: return LDKBolt12SemanticError_MissingPaths; - case 23: return LDKBolt12SemanticError_UnexpectedPaths; - case 24: return LDKBolt12SemanticError_InvalidPayInfo; - case 25: return LDKBolt12SemanticError_MissingCreationTime; - case 26: return LDKBolt12SemanticError_MissingPaymentHash; - case 27: return LDKBolt12SemanticError_UnexpectedPaymentHash; - case 28: return LDKBolt12SemanticError_MissingSignature; + case 11: return LDKBolt12SemanticError_MissingIssuerSigningPubkey; + case 12: return LDKBolt12SemanticError_UnexpectedIssuerSigningPubkey; + case 13: return LDKBolt12SemanticError_MissingQuantity; + case 14: return LDKBolt12SemanticError_InvalidQuantity; + case 15: return LDKBolt12SemanticError_UnexpectedQuantity; + case 16: return LDKBolt12SemanticError_InvalidMetadata; + case 17: return LDKBolt12SemanticError_UnexpectedMetadata; + case 18: return LDKBolt12SemanticError_MissingPayerMetadata; + case 19: return LDKBolt12SemanticError_MissingPayerSigningPubkey; + case 20: return LDKBolt12SemanticError_DuplicatePaymentId; + case 21: return LDKBolt12SemanticError_MissingPaths; + case 22: return LDKBolt12SemanticError_UnexpectedPaths; + case 23: return LDKBolt12SemanticError_InvalidPayInfo; + case 24: return LDKBolt12SemanticError_MissingCreationTime; + case 25: return LDKBolt12SemanticError_MissingPaymentHash; + case 26: return LDKBolt12SemanticError_UnexpectedPaymentHash; + case 27: return LDKBolt12SemanticError_MissingSigningPubkey; + case 28: return LDKBolt12SemanticError_InvalidSigningPubkey; + case 29: return LDKBolt12SemanticError_MissingSignature; + case 30: return LDKBolt12SemanticError_UnexpectedHumanReadableName; } (*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 @@ -457,16 +459,15 @@ static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnsupportedCurrency = static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnknownRequiredFeatures = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedFeatures = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingDescription = NULL; -static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingSigningPubkey = NULL; -static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_InvalidSigningPubkey = NULL; -static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedSigningPubkey = NULL; +static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingIssuerSigningPubkey = NULL; +static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedIssuerSigningPubkey = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingQuantity = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_InvalidQuantity = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedQuantity = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_InvalidMetadata = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedMetadata = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerMetadata = NULL; -static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerId = NULL; +static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerSigningPubkey = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_DuplicatePaymentId = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingPaths = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedPaths = NULL; @@ -474,7 +475,10 @@ 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_MissingSigningPubkey = NULL; +static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_InvalidSigningPubkey = NULL; static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_MissingSignature = NULL; +static jfieldID Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedHumanReadableName = NULL; JNIEXPORT void JNICALL Java_org_ldk_enums_Bolt12SemanticError_init (JNIEnv *env, jclass clz) { Bolt12SemanticError_class = (*env)->NewGlobalRef(env, clz); CHECK(Bolt12SemanticError_class != NULL); @@ -500,12 +504,10 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_Bolt12SemanticError_init (JNIEnv *env, CHECK(Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedFeatures != NULL); Bolt12SemanticError_LDKBolt12SemanticError_MissingDescription = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingDescription", "Lorg/ldk/enums/Bolt12SemanticError;"); CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingDescription != NULL); - Bolt12SemanticError_LDKBolt12SemanticError_MissingSigningPubkey = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingSigningPubkey", "Lorg/ldk/enums/Bolt12SemanticError;"); - CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingSigningPubkey != NULL); - Bolt12SemanticError_LDKBolt12SemanticError_InvalidSigningPubkey = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_InvalidSigningPubkey", "Lorg/ldk/enums/Bolt12SemanticError;"); - CHECK(Bolt12SemanticError_LDKBolt12SemanticError_InvalidSigningPubkey != NULL); - Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedSigningPubkey = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_UnexpectedSigningPubkey", "Lorg/ldk/enums/Bolt12SemanticError;"); - CHECK(Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedSigningPubkey != NULL); + Bolt12SemanticError_LDKBolt12SemanticError_MissingIssuerSigningPubkey = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingIssuerSigningPubkey", "Lorg/ldk/enums/Bolt12SemanticError;"); + CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingIssuerSigningPubkey != NULL); + Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedIssuerSigningPubkey = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_UnexpectedIssuerSigningPubkey", "Lorg/ldk/enums/Bolt12SemanticError;"); + CHECK(Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedIssuerSigningPubkey != NULL); Bolt12SemanticError_LDKBolt12SemanticError_MissingQuantity = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingQuantity", "Lorg/ldk/enums/Bolt12SemanticError;"); CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingQuantity != NULL); Bolt12SemanticError_LDKBolt12SemanticError_InvalidQuantity = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_InvalidQuantity", "Lorg/ldk/enums/Bolt12SemanticError;"); @@ -518,8 +520,8 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_Bolt12SemanticError_init (JNIEnv *env, CHECK(Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedMetadata != NULL); Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerMetadata = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingPayerMetadata", "Lorg/ldk/enums/Bolt12SemanticError;"); CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerMetadata != NULL); - Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerId = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingPayerId", "Lorg/ldk/enums/Bolt12SemanticError;"); - CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerId != NULL); + Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerSigningPubkey = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingPayerSigningPubkey", "Lorg/ldk/enums/Bolt12SemanticError;"); + CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerSigningPubkey != NULL); Bolt12SemanticError_LDKBolt12SemanticError_DuplicatePaymentId = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_DuplicatePaymentId", "Lorg/ldk/enums/Bolt12SemanticError;"); CHECK(Bolt12SemanticError_LDKBolt12SemanticError_DuplicatePaymentId != NULL); Bolt12SemanticError_LDKBolt12SemanticError_MissingPaths = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingPaths", "Lorg/ldk/enums/Bolt12SemanticError;"); @@ -534,8 +536,14 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_Bolt12SemanticError_init (JNIEnv *env, 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_MissingSigningPubkey = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingSigningPubkey", "Lorg/ldk/enums/Bolt12SemanticError;"); + CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingSigningPubkey != NULL); + Bolt12SemanticError_LDKBolt12SemanticError_InvalidSigningPubkey = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_InvalidSigningPubkey", "Lorg/ldk/enums/Bolt12SemanticError;"); + CHECK(Bolt12SemanticError_LDKBolt12SemanticError_InvalidSigningPubkey != NULL); Bolt12SemanticError_LDKBolt12SemanticError_MissingSignature = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_MissingSignature", "Lorg/ldk/enums/Bolt12SemanticError;"); CHECK(Bolt12SemanticError_LDKBolt12SemanticError_MissingSignature != NULL); + Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedHumanReadableName = (*env)->GetStaticFieldID(env, Bolt12SemanticError_class, "LDKBolt12SemanticError_UnexpectedHumanReadableName", "Lorg/ldk/enums/Bolt12SemanticError;"); + CHECK(Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedHumanReadableName != NULL); } static inline jclass LDKBolt12SemanticError_to_java(JNIEnv *env, LDKBolt12SemanticError val) { switch (val) { @@ -561,12 +569,10 @@ static inline jclass LDKBolt12SemanticError_to_java(JNIEnv *env, LDKBolt12Semant return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedFeatures); case LDKBolt12SemanticError_MissingDescription: return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingDescription); - case LDKBolt12SemanticError_MissingSigningPubkey: - return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingSigningPubkey); - case LDKBolt12SemanticError_InvalidSigningPubkey: - return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_InvalidSigningPubkey); - case LDKBolt12SemanticError_UnexpectedSigningPubkey: - return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedSigningPubkey); + case LDKBolt12SemanticError_MissingIssuerSigningPubkey: + return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingIssuerSigningPubkey); + case LDKBolt12SemanticError_UnexpectedIssuerSigningPubkey: + return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedIssuerSigningPubkey); case LDKBolt12SemanticError_MissingQuantity: return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingQuantity); case LDKBolt12SemanticError_InvalidQuantity: @@ -579,8 +585,8 @@ static inline jclass LDKBolt12SemanticError_to_java(JNIEnv *env, LDKBolt12Semant return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedMetadata); case LDKBolt12SemanticError_MissingPayerMetadata: return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerMetadata); - case LDKBolt12SemanticError_MissingPayerId: - return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerId); + case LDKBolt12SemanticError_MissingPayerSigningPubkey: + return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingPayerSigningPubkey); case LDKBolt12SemanticError_DuplicatePaymentId: return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_DuplicatePaymentId); case LDKBolt12SemanticError_MissingPaths: @@ -595,8 +601,14 @@ static inline jclass LDKBolt12SemanticError_to_java(JNIEnv *env, LDKBolt12Semant return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingPaymentHash); case LDKBolt12SemanticError_UnexpectedPaymentHash: return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedPaymentHash); + case LDKBolt12SemanticError_MissingSigningPubkey: + return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingSigningPubkey); + case LDKBolt12SemanticError_InvalidSigningPubkey: + return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_InvalidSigningPubkey); case LDKBolt12SemanticError_MissingSignature: return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_MissingSignature); + case LDKBolt12SemanticError_UnexpectedHumanReadableName: + return (*env)->GetStaticObjectField(env, Bolt12SemanticError_class, Bolt12SemanticError_LDKBolt12SemanticError_UnexpectedHumanReadableName); default: abort(); } } @@ -1335,6 +1347,7 @@ static inline LDKPaymentFailureReason LDKPaymentFailureReason_from_java(JNIEnv * case 6: return LDKPaymentFailureReason_UnknownRequiredFeatures; case 7: return LDKPaymentFailureReason_InvoiceRequestExpired; case 8: return LDKPaymentFailureReason_InvoiceRequestRejected; + case 9: return LDKPaymentFailureReason_BlindedPathCreationFailed; } (*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 @@ -1349,6 +1362,7 @@ static jfieldID PaymentFailureReason_LDKPaymentFailureReason_UnexpectedError = N static jfieldID PaymentFailureReason_LDKPaymentFailureReason_UnknownRequiredFeatures = NULL; static jfieldID PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestExpired = NULL; static jfieldID PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestRejected = NULL; +static jfieldID PaymentFailureReason_LDKPaymentFailureReason_BlindedPathCreationFailed = NULL; JNIEXPORT void JNICALL Java_org_ldk_enums_PaymentFailureReason_init (JNIEnv *env, jclass clz) { PaymentFailureReason_class = (*env)->NewGlobalRef(env, clz); CHECK(PaymentFailureReason_class != NULL); @@ -1370,6 +1384,8 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_PaymentFailureReason_init (JNIEnv *env CHECK(PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestExpired != NULL); PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestRejected = (*env)->GetStaticFieldID(env, PaymentFailureReason_class, "LDKPaymentFailureReason_InvoiceRequestRejected", "Lorg/ldk/enums/PaymentFailureReason;"); CHECK(PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestRejected != NULL); + PaymentFailureReason_LDKPaymentFailureReason_BlindedPathCreationFailed = (*env)->GetStaticFieldID(env, PaymentFailureReason_class, "LDKPaymentFailureReason_BlindedPathCreationFailed", "Lorg/ldk/enums/PaymentFailureReason;"); + CHECK(PaymentFailureReason_LDKPaymentFailureReason_BlindedPathCreationFailed != NULL); } static inline jclass LDKPaymentFailureReason_to_java(JNIEnv *env, LDKPaymentFailureReason val) { switch (val) { @@ -1391,6 +1407,8 @@ static inline jclass LDKPaymentFailureReason_to_java(JNIEnv *env, LDKPaymentFail return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestExpired); case LDKPaymentFailureReason_InvoiceRequestRejected: return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_InvoiceRequestRejected); + case LDKPaymentFailureReason_BlindedPathCreationFailed: + return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_BlindedPathCreationFailed); default: abort(); } } @@ -2122,122 +2140,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RetryDecodeErrorZ_ return ret_ref; } -static jclass LDKAPIError_APIMisuseError_class = NULL; -static jmethodID LDKAPIError_APIMisuseError_meth = NULL; -static jclass LDKAPIError_FeeRateTooHigh_class = NULL; -static jmethodID LDKAPIError_FeeRateTooHigh_meth = NULL; -static jclass LDKAPIError_InvalidRoute_class = NULL; -static jmethodID LDKAPIError_InvalidRoute_meth = NULL; -static jclass LDKAPIError_ChannelUnavailable_class = NULL; -static jmethodID LDKAPIError_ChannelUnavailable_meth = NULL; -static jclass LDKAPIError_MonitorUpdateInProgress_class = NULL; -static jmethodID LDKAPIError_MonitorUpdateInProgress_meth = NULL; -static jclass LDKAPIError_IncompatibleShutdownScript_class = NULL; -static jmethodID LDKAPIError_IncompatibleShutdownScript_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv *env, jclass clz) { - LDKAPIError_APIMisuseError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$APIMisuseError")); - CHECK(LDKAPIError_APIMisuseError_class != NULL); - LDKAPIError_APIMisuseError_meth = (*env)->GetMethodID(env, LDKAPIError_APIMisuseError_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKAPIError_APIMisuseError_meth != NULL); - LDKAPIError_FeeRateTooHigh_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$FeeRateTooHigh")); - CHECK(LDKAPIError_FeeRateTooHigh_class != NULL); - LDKAPIError_FeeRateTooHigh_meth = (*env)->GetMethodID(env, LDKAPIError_FeeRateTooHigh_class, "", "(Ljava/lang/String;I)V"); - CHECK(LDKAPIError_FeeRateTooHigh_meth != NULL); - LDKAPIError_InvalidRoute_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$InvalidRoute")); - CHECK(LDKAPIError_InvalidRoute_class != NULL); - LDKAPIError_InvalidRoute_meth = (*env)->GetMethodID(env, LDKAPIError_InvalidRoute_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKAPIError_InvalidRoute_meth != NULL); - LDKAPIError_ChannelUnavailable_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$ChannelUnavailable")); - CHECK(LDKAPIError_ChannelUnavailable_class != NULL); - LDKAPIError_ChannelUnavailable_meth = (*env)->GetMethodID(env, LDKAPIError_ChannelUnavailable_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKAPIError_ChannelUnavailable_meth != NULL); - LDKAPIError_MonitorUpdateInProgress_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$MonitorUpdateInProgress")); - CHECK(LDKAPIError_MonitorUpdateInProgress_class != NULL); - LDKAPIError_MonitorUpdateInProgress_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateInProgress_class, "", "()V"); - CHECK(LDKAPIError_MonitorUpdateInProgress_meth != NULL); - LDKAPIError_IncompatibleShutdownScript_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$IncompatibleShutdownScript")); - CHECK(LDKAPIError_IncompatibleShutdownScript_class != NULL); - LDKAPIError_IncompatibleShutdownScript_meth = (*env)->GetMethodID(env, LDKAPIError_IncompatibleShutdownScript_class, "", "(J)V"); - CHECK(LDKAPIError_IncompatibleShutdownScript_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr); - switch(obj->tag) { - case LDKAPIError_APIMisuseError: { - LDKStr err_str = obj->api_misuse_error.err; - jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); - return (*env)->NewObject(env, LDKAPIError_APIMisuseError_class, LDKAPIError_APIMisuseError_meth, err_conv); - } - case LDKAPIError_FeeRateTooHigh: { - LDKStr err_str = obj->fee_rate_too_high.err; - jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); - int32_t feerate_conv = obj->fee_rate_too_high.feerate; - return (*env)->NewObject(env, LDKAPIError_FeeRateTooHigh_class, LDKAPIError_FeeRateTooHigh_meth, err_conv, feerate_conv); - } - case LDKAPIError_InvalidRoute: { - LDKStr err_str = obj->invalid_route.err; - jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); - return (*env)->NewObject(env, LDKAPIError_InvalidRoute_class, LDKAPIError_InvalidRoute_meth, err_conv); - } - case LDKAPIError_ChannelUnavailable: { - LDKStr err_str = obj->channel_unavailable.err; - jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); - return (*env)->NewObject(env, LDKAPIError_ChannelUnavailable_class, LDKAPIError_ChannelUnavailable_meth, err_conv); - } - case LDKAPIError_MonitorUpdateInProgress: { - return (*env)->NewObject(env, LDKAPIError_MonitorUpdateInProgress_class, LDKAPIError_MonitorUpdateInProgress_meth); - } - case LDKAPIError_IncompatibleShutdownScript: { - LDKShutdownScript script_var = obj->incompatible_shutdown_script.script; - int64_t script_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var); - script_ref = tag_ptr(script_var.inner, false); - return (*env)->NewObject(env, LDKAPIError_IncompatibleShutdownScript_class, LDKAPIError_IncompatibleShutdownScript_meth, script_ref); - } - default: abort(); - } -} -static inline void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner); - CResult_NoneAPIErrorZ_get_ok(owner_conv); -} - -static inline struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return APIError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = CResult_NoneAPIErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) { - LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = CResult_NoneAPIErrorZ_clone(&orig->data[i]); - } - return ret; -} -static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) { - LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = APIError_clone(&orig->data[i]); - } - return ret; -} static jclass LDKCOption_ThirtyTwoBytesZ_Some_class = NULL; static jmethodID LDKCOption_ThirtyTwoBytesZ_Some_meth = NULL; static jclass LDKCOption_ThirtyTwoBytesZ_None_class = NULL; @@ -2376,266 +2278,905 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsN CResult_RecipientOnionFieldsNoneZ_get_err(owner_conv); } -static inline struct LDKUnsignedBolt12Invoice CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ - LDKUnsignedBolt12Invoice ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedBolt12InvoiceBolt12SemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); - LDKUnsignedBolt12Invoice ret_var = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_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 jclass LDKDNSResolverMessage_DNSSECQuery_class = NULL; +static jmethodID LDKDNSResolverMessage_DNSSECQuery_meth = NULL; +static jclass LDKDNSResolverMessage_DNSSECProof_class = NULL; +static jmethodID LDKDNSResolverMessage_DNSSECProof_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDNSResolverMessage_init (JNIEnv *env, jclass clz) { + LDKDNSResolverMessage_DNSSECQuery_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDNSResolverMessage$DNSSECQuery")); + CHECK(LDKDNSResolverMessage_DNSSECQuery_class != NULL); + LDKDNSResolverMessage_DNSSECQuery_meth = (*env)->GetMethodID(env, LDKDNSResolverMessage_DNSSECQuery_class, "", "(J)V"); + CHECK(LDKDNSResolverMessage_DNSSECQuery_meth != NULL); + LDKDNSResolverMessage_DNSSECProof_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDNSResolverMessage$DNSSECProof")); + CHECK(LDKDNSResolverMessage_DNSSECProof_class != NULL); + LDKDNSResolverMessage_DNSSECProof_meth = (*env)->GetMethodID(env, LDKDNSResolverMessage_DNSSECProof_class, "", "(J)V"); + CHECK(LDKDNSResolverMessage_DNSSECProof_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDNSResolverMessage_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKDNSResolverMessage *obj = (LDKDNSResolverMessage*)untag_ptr(ptr); + switch(obj->tag) { + case LDKDNSResolverMessage_DNSSECQuery: { + LDKDNSSECQuery dnssec_query_var = obj->dnssec_query; + int64_t dnssec_query_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(dnssec_query_var); + dnssec_query_ref = tag_ptr(dnssec_query_var.inner, false); + return (*env)->NewObject(env, LDKDNSResolverMessage_DNSSECQuery_class, LDKDNSResolverMessage_DNSSECQuery_meth, dnssec_query_ref); + } + case LDKDNSResolverMessage_DNSSECProof: { + LDKDNSSECProof dnssec_proof_var = obj->dnssec_proof; + int64_t dnssec_proof_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(dnssec_proof_var); + dnssec_proof_ref = tag_ptr(dnssec_proof_var.inner, false); + return (*env)->NewObject(env, LDKDNSResolverMessage_DNSSECProof_class, LDKDNSResolverMessage_DNSSECProof_meth, dnssec_proof_ref); + } + default: abort(); + } } - -static inline enum LDKBolt12SemanticError CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return Bolt12SemanticError_clone(&*owner->contents.err); +static inline struct LDKDNSResolverMessage C2Tuple_DNSResolverMessageResponseInstructionZ_get_a(LDKC2Tuple_DNSResolverMessageResponseInstructionZ *NONNULL_PTR owner){ + return DNSResolverMessage_clone(&owner->a); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedBolt12InvoiceBolt12SemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKBolt12SemanticError_to_java(env, CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(owner_conv)); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageResponseInstructionZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_DNSResolverMessageResponseInstructionZ* owner_conv = (LDKC2Tuple_DNSResolverMessageResponseInstructionZ*)untag_ptr(owner); + LDKDNSResolverMessage *ret_copy = MALLOC(sizeof(LDKDNSResolverMessage), "LDKDNSResolverMessage"); + *ret_copy = C2Tuple_DNSResolverMessageResponseInstructionZ_get_a(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline struct LDKBolt12Invoice CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ - LDKBolt12Invoice ret = *owner->contents.result; +static inline struct LDKResponseInstruction C2Tuple_DNSResolverMessageResponseInstructionZ_get_b(LDKC2Tuple_DNSResolverMessageResponseInstructionZ *NONNULL_PTR owner){ + LDKResponseInstruction ret = owner->b; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceBolt12SemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); - LDKBolt12Invoice ret_var = CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageResponseInstructionZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_DNSResolverMessageResponseInstructionZ* owner_conv = (LDKC2Tuple_DNSResolverMessageResponseInstructionZ*)untag_ptr(owner); + LDKResponseInstruction ret_var = C2Tuple_DNSResolverMessageResponseInstructionZ_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 enum LDKBolt12SemanticError CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return Bolt12SemanticError_clone(&*owner->contents.err); -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceBolt12SemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKBolt12SemanticError_to_java(env, CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline struct LDKSchnorrSignature CResult_SchnorrSignatureNoneZ_get_ok(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SchnorrSignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CResult_SchnorrSignatureNoneZ_get_ok(owner_conv).compact_form); - return ret_arr; -} - -static inline void CResult_SchnorrSignatureNoneZ_get_err(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SchnorrSignatureNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); - CResult_SchnorrSignatureNoneZ_get_err(owner_conv); +static jclass LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some_class = NULL; +static jmethodID LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some_meth = NULL; +static jclass LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None_class = NULL; +static jmethodID LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1DNSResolverMessageResponseInstructionZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ$Some")); + CHECK(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some_class != NULL); + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some_meth != NULL); + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ$None")); + CHECK(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None_class != NULL); + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None_class, "", "()V"); + CHECK(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None_meth != NULL); } - -static inline LDKCVec_ThirtyTwoBytesZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_ThirtyTwoBytesZ *orig) { - LDKCVec_ThirtyTwoBytesZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_ThirtyTwoBytesZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1DNSResolverMessageResponseInstructionZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ *obj = (LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some: { + LDKC2Tuple_DNSResolverMessageResponseInstructionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_DNSResolverMessageResponseInstructionZ), "LDKC2Tuple_DNSResolverMessageResponseInstructionZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_DNSResolverMessageResponseInstructionZ_clone(some_conv); + return (*env)->NewObject(env, LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some_class, LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_Some_meth, tag_ptr(some_conv, true)); + } + case LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None: { + return (*env)->NewObject(env, LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None_class, LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_None_meth); + } + default: abort(); } - return ret; } -static jclass LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class = NULL; -static jmethodID LDKCOption_CVec_ThirtyTwoBytesZZ_Some_meth = NULL; -static jclass LDKCOption_CVec_ThirtyTwoBytesZZ_None_class = NULL; -static jmethodID LDKCOption_CVec_ThirtyTwoBytesZZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CVec_1ThirtyTwoBytesZZ_init (JNIEnv *env, jclass clz) { - LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_ThirtyTwoBytesZZ$Some")); - CHECK(LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class != NULL); - LDKCOption_CVec_ThirtyTwoBytesZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class, "", "([[B)V"); - CHECK(LDKCOption_CVec_ThirtyTwoBytesZZ_Some_meth != NULL); - LDKCOption_CVec_ThirtyTwoBytesZZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_ThirtyTwoBytesZZ$None")); - CHECK(LDKCOption_CVec_ThirtyTwoBytesZZ_None_class != NULL); - LDKCOption_CVec_ThirtyTwoBytesZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CVec_ThirtyTwoBytesZZ_None_class, "", "()V"); - CHECK(LDKCOption_CVec_ThirtyTwoBytesZZ_None_meth != NULL); +static jclass LDKDestination_Node_class = NULL; +static jmethodID LDKDestination_Node_meth = NULL; +static jclass LDKDestination_BlindedPath_class = NULL; +static jmethodID LDKDestination_BlindedPath_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDestination_init (JNIEnv *env, jclass clz) { + LDKDestination_Node_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$Node")); + CHECK(LDKDestination_Node_class != NULL); + LDKDestination_Node_meth = (*env)->GetMethodID(env, LDKDestination_Node_class, "", "([B)V"); + CHECK(LDKDestination_Node_meth != NULL); + LDKDestination_BlindedPath_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$BlindedPath")); + CHECK(LDKDestination_BlindedPath_class != NULL); + LDKDestination_BlindedPath_meth = (*env)->GetMethodID(env, LDKDestination_BlindedPath_class, "", "(J)V"); + CHECK(LDKDestination_BlindedPath_meth != NULL); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1ThirtyTwoBytesZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_CVec_ThirtyTwoBytesZZ *obj = (LDKCOption_CVec_ThirtyTwoBytesZZ*)untag_ptr(ptr); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKDestination *obj = (LDKDestination*)untag_ptr(ptr); switch(obj->tag) { - case LDKCOption_CVec_ThirtyTwoBytesZZ_Some: { - LDKCVec_ThirtyTwoBytesZ some_var = obj->some; - jobjectArray some_arr = NULL; - some_arr = (*env)->NewObjectArray(env, some_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < some_var.datalen; i++) { - int8_tArray some_conv_8_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, some_conv_8_arr, 0, 32, some_var.data[i].data); - (*env)->SetObjectArrayElement(env, some_arr, i, some_conv_8_arr); - } - - return (*env)->NewObject(env, LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class, LDKCOption_CVec_ThirtyTwoBytesZZ_Some_meth, some_arr); + case LDKDestination_Node: { + int8_tArray node_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, node_arr, 0, 33, obj->node.compressed_form); + return (*env)->NewObject(env, LDKDestination_Node_class, LDKDestination_Node_meth, node_arr); } - case LDKCOption_CVec_ThirtyTwoBytesZZ_None: { - return (*env)->NewObject(env, LDKCOption_CVec_ThirtyTwoBytesZZ_None_class, LDKCOption_CVec_ThirtyTwoBytesZZ_None_meth); + case LDKDestination_BlindedPath: { + 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); + return (*env)->NewObject(env, LDKDestination_BlindedPath_class, LDKDestination_BlindedPath_meth, blinded_path_ref); } default: abort(); } } -static jclass LDKAmount_Bitcoin_class = NULL; -static jmethodID LDKAmount_Bitcoin_meth = NULL; -static jclass LDKAmount_Currency_class = NULL; -static jmethodID LDKAmount_Currency_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAmount_init (JNIEnv *env, jclass clz) { - LDKAmount_Bitcoin_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAmount$Bitcoin")); - CHECK(LDKAmount_Bitcoin_class != NULL); - LDKAmount_Bitcoin_meth = (*env)->GetMethodID(env, LDKAmount_Bitcoin_class, "", "(J)V"); - CHECK(LDKAmount_Bitcoin_meth != NULL); - LDKAmount_Currency_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAmount$Currency")); - CHECK(LDKAmount_Currency_class != NULL); - LDKAmount_Currency_meth = (*env)->GetMethodID(env, LDKAmount_Currency_class, "", "([BJ)V"); - CHECK(LDKAmount_Currency_meth != NULL); +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, "", "([BJ[B)V"); + CHECK(LDKOffersContext_InboundPayment_meth != NULL); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAmount_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKAmount *obj = (LDKAmount*)untag_ptr(ptr); +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 LDKAmount_Bitcoin: { - int64_t amount_msats_conv = obj->bitcoin.amount_msats; - return (*env)->NewObject(env, LDKAmount_Bitcoin_class, LDKAmount_Bitcoin_meth, amount_msats_conv); + 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 LDKAmount_Currency: { - int8_tArray iso4217_code_arr = (*env)->NewByteArray(env, 3); - (*env)->SetByteArrayRegion(env, iso4217_code_arr, 0, 3, obj->currency.iso4217_code.data); - int64_t amount_conv = obj->currency.amount; - return (*env)->NewObject(env, LDKAmount_Currency_class, LDKAmount_Currency_meth, iso4217_code_arr, amount_conv); + 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); + LDKNonce nonce_var = obj->inbound_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->inbound_payment.hmac.data); + return (*env)->NewObject(env, LDKOffersContext_InboundPayment_class, LDKOffersContext_InboundPayment_meth, payment_hash_arr, nonce_ref, hmac_arr); } default: abort(); } } -static jclass LDKCOption_AmountZ_Some_class = NULL; -static jmethodID LDKCOption_AmountZ_Some_meth = NULL; -static jclass LDKCOption_AmountZ_None_class = NULL; -static jmethodID LDKCOption_AmountZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1AmountZ_init (JNIEnv *env, jclass clz) { - LDKCOption_AmountZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AmountZ$Some")); - CHECK(LDKCOption_AmountZ_Some_class != NULL); - LDKCOption_AmountZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_AmountZ_Some_class, "", "(J)V"); - CHECK(LDKCOption_AmountZ_Some_meth != NULL); - LDKCOption_AmountZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AmountZ$None")); - CHECK(LDKCOption_AmountZ_None_class != NULL); - LDKCOption_AmountZ_None_meth = (*env)->GetMethodID(env, LDKCOption_AmountZ_None_class, "", "()V"); - CHECK(LDKCOption_AmountZ_None_meth != NULL); +static jclass LDKAsyncPaymentsContext_OutboundPayment_class = NULL; +static jmethodID LDKAsyncPaymentsContext_OutboundPayment_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAsyncPaymentsContext_init (JNIEnv *env, jclass clz) { + LDKAsyncPaymentsContext_OutboundPayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAsyncPaymentsContext$OutboundPayment")); + CHECK(LDKAsyncPaymentsContext_OutboundPayment_class != NULL); + LDKAsyncPaymentsContext_OutboundPayment_meth = (*env)->GetMethodID(env, LDKAsyncPaymentsContext_OutboundPayment_class, "", "([BJ[B)V"); + CHECK(LDKAsyncPaymentsContext_OutboundPayment_meth != NULL); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1AmountZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_AmountZ *obj = (LDKCOption_AmountZ*)untag_ptr(ptr); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAsyncPaymentsContext_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKAsyncPaymentsContext *obj = (LDKAsyncPaymentsContext*)untag_ptr(ptr); switch(obj->tag) { - case LDKCOption_AmountZ_Some: { - int64_t some_ref = tag_ptr(&obj->some, false); - return (*env)->NewObject(env, LDKCOption_AmountZ_Some_class, LDKCOption_AmountZ_Some_meth, some_ref); - } - case LDKCOption_AmountZ_None: { - return (*env)->NewObject(env, LDKCOption_AmountZ_None_class, LDKCOption_AmountZ_None_meth); + case LDKAsyncPaymentsContext_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, LDKAsyncPaymentsContext_OutboundPayment_class, LDKAsyncPaymentsContext_OutboundPayment_meth, payment_id_arr, nonce_ref, hmac_arr); } default: abort(); } } -static jclass LDKQuantity_Bounded_class = NULL; -static jmethodID LDKQuantity_Bounded_meth = NULL; -static jclass LDKQuantity_Unbounded_class = NULL; -static jmethodID LDKQuantity_Unbounded_meth = NULL; -static jclass LDKQuantity_One_class = NULL; -static jmethodID LDKQuantity_One_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKQuantity_init (JNIEnv *env, jclass clz) { - LDKQuantity_Bounded_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKQuantity$Bounded")); - CHECK(LDKQuantity_Bounded_class != NULL); - LDKQuantity_Bounded_meth = (*env)->GetMethodID(env, LDKQuantity_Bounded_class, "", "(J)V"); - CHECK(LDKQuantity_Bounded_meth != NULL); - LDKQuantity_Unbounded_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKQuantity$Unbounded")); - CHECK(LDKQuantity_Unbounded_class != NULL); - LDKQuantity_Unbounded_meth = (*env)->GetMethodID(env, LDKQuantity_Unbounded_class, "", "()V"); - CHECK(LDKQuantity_Unbounded_meth != NULL); - LDKQuantity_One_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKQuantity$One")); - CHECK(LDKQuantity_One_class != NULL); - LDKQuantity_One_meth = (*env)->GetMethodID(env, LDKQuantity_One_class, "", "()V"); - CHECK(LDKQuantity_One_meth != NULL); +static jclass LDKMessageContext_Offers_class = NULL; +static jmethodID LDKMessageContext_Offers_meth = NULL; +static jclass LDKMessageContext_AsyncPayments_class = NULL; +static jmethodID LDKMessageContext_AsyncPayments_meth = NULL; +static jclass LDKMessageContext_DNSResolver_class = NULL; +static jmethodID LDKMessageContext_DNSResolver_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_AsyncPayments_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageContext$AsyncPayments")); + CHECK(LDKMessageContext_AsyncPayments_class != NULL); + LDKMessageContext_AsyncPayments_meth = (*env)->GetMethodID(env, LDKMessageContext_AsyncPayments_class, "", "(J)V"); + CHECK(LDKMessageContext_AsyncPayments_meth != NULL); + LDKMessageContext_DNSResolver_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageContext$DNSResolver")); + CHECK(LDKMessageContext_DNSResolver_class != NULL); + LDKMessageContext_DNSResolver_meth = (*env)->GetMethodID(env, LDKMessageContext_DNSResolver_class, "", "(J)V"); + CHECK(LDKMessageContext_DNSResolver_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_LDKQuantity_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKQuantity *obj = (LDKQuantity*)untag_ptr(ptr); +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 LDKQuantity_Bounded: { - int64_t bounded_conv = obj->bounded; - return (*env)->NewObject(env, LDKQuantity_Bounded_class, LDKQuantity_Bounded_meth, bounded_conv); + 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 LDKQuantity_Unbounded: { - return (*env)->NewObject(env, LDKQuantity_Unbounded_class, LDKQuantity_Unbounded_meth); + case LDKMessageContext_AsyncPayments: { + int64_t async_payments_ref = tag_ptr(&obj->async_payments, false); + return (*env)->NewObject(env, LDKMessageContext_AsyncPayments_class, LDKMessageContext_AsyncPayments_meth, async_payments_ref); } - case LDKQuantity_One: { - return (*env)->NewObject(env, LDKQuantity_One_class, LDKQuantity_One_meth); + case LDKMessageContext_DNSResolver: { + LDKDNSResolverContext dns_resolver_var = obj->dns_resolver; + int64_t dns_resolver_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(dns_resolver_var); + dns_resolver_ref = tag_ptr(dns_resolver_var.inner, false); + return (*env)->NewObject(env, LDKMessageContext_DNSResolver_class, LDKMessageContext_DNSResolver_meth, dns_resolver_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 LDKCOption_QuantityZ_Some_class = NULL; -static jmethodID LDKCOption_QuantityZ_Some_meth = NULL; -static jclass LDKCOption_QuantityZ_None_class = NULL; -static jmethodID LDKCOption_QuantityZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1QuantityZ_init (JNIEnv *env, jclass clz) { - LDKCOption_QuantityZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_QuantityZ$Some")); - CHECK(LDKCOption_QuantityZ_Some_class != NULL); - LDKCOption_QuantityZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_QuantityZ_Some_class, "", "(J)V"); - CHECK(LDKCOption_QuantityZ_Some_meth != NULL); - LDKCOption_QuantityZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_QuantityZ$None")); - CHECK(LDKCOption_QuantityZ_None_class != NULL); - LDKCOption_QuantityZ_None_meth = (*env)->GetMethodID(env, LDKCOption_QuantityZ_None_class, "", "()V"); - CHECK(LDKCOption_QuantityZ_None_meth != NULL); +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_LDKCOption_1QuantityZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_QuantityZ *obj = (LDKCOption_QuantityZ*)untag_ptr(ptr); +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 LDKCOption_QuantityZ_Some: { - int64_t some_ref = tag_ptr(&obj->some, false); - return (*env)->NewObject(env, LDKCOption_QuantityZ_Some_class, LDKCOption_QuantityZ_Some_meth, some_ref); + 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 LDKCOption_QuantityZ_None: { - return (*env)->NewObject(env, LDKCOption_QuantityZ_None_class, LDKCOption_QuantityZ_None_meth); + 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 LDKThirtyTwoBytes CResult_ThirtyTwoBytesNoneZ_get_ok(LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return ThirtyTwoBytes_clone(&*owner->contents.result); +static inline struct LDKDNSResolverMessage C2Tuple_DNSResolverMessageMessageSendInstructionsZ_get_a(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ *NONNULL_PTR owner){ + return DNSResolverMessage_clone(&owner->a); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ThirtyTwoBytesNoneZ* owner_conv = (LDKCResult_ThirtyTwoBytesNoneZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_ThirtyTwoBytesNoneZ_get_ok(owner_conv).data); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageMessageSendInstructionsZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ*)untag_ptr(owner); + LDKDNSResolverMessage *ret_copy = MALLOC(sizeof(LDKDNSResolverMessage), "LDKDNSResolverMessage"); + *ret_copy = C2Tuple_DNSResolverMessageMessageSendInstructionsZ_get_a(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline void CResult_ThirtyTwoBytesNoneZ_get_err(LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; +static inline struct LDKMessageSendInstructions C2Tuple_DNSResolverMessageMessageSendInstructionsZ_get_b(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ *NONNULL_PTR owner){ + return MessageSendInstructions_clone(&owner->b); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ThirtyTwoBytesNoneZ* owner_conv = (LDKCResult_ThirtyTwoBytesNoneZ*)untag_ptr(owner); - CResult_ThirtyTwoBytesNoneZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageMessageSendInstructionsZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ* owner_conv = (LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ*)untag_ptr(owner); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = C2Tuple_DNSResolverMessageMessageSendInstructionsZ_get_b(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ CVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ_clone(const LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ *orig) { + LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ) * orig->datalen, "LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_DNSResolverMessageMessageSendInstructionsZ_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKDNSResolverMessage CResult_DNSResolverMessageDecodeErrorZ_get_ok(LDKCResult_DNSResolverMessageDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return DNSResolverMessage_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_DNSResolverMessageDecodeErrorZ* owner_conv = (LDKCResult_DNSResolverMessageDecodeErrorZ*)untag_ptr(owner); + LDKDNSResolverMessage *ret_copy = MALLOC(sizeof(LDKDNSResolverMessage), "LDKDNSResolverMessage"); + *ret_copy = CResult_DNSResolverMessageDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_DNSResolverMessageDecodeErrorZ_get_err(LDKCResult_DNSResolverMessageDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_DNSResolverMessageDecodeErrorZ* owner_conv = (LDKCResult_DNSResolverMessageDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_DNSResolverMessageDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKHumanReadableName CResult_HumanReadableNameNoneZ_get_ok(LDKCResult_HumanReadableNameNoneZ *NONNULL_PTR owner){ + LDKHumanReadableName ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_HumanReadableNameNoneZ* owner_conv = (LDKCResult_HumanReadableNameNoneZ*)untag_ptr(owner); + LDKHumanReadableName ret_var = CResult_HumanReadableNameNoneZ_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_HumanReadableNameNoneZ_get_err(LDKCResult_HumanReadableNameNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_HumanReadableNameNoneZ* owner_conv = (LDKCResult_HumanReadableNameNoneZ*)untag_ptr(owner); + CResult_HumanReadableNameNoneZ_get_err(owner_conv); +} + +static inline struct LDKHumanReadableName CResult_HumanReadableNameDecodeErrorZ_get_ok(LDKCResult_HumanReadableNameDecodeErrorZ *NONNULL_PTR owner){ + LDKHumanReadableName ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_HumanReadableNameDecodeErrorZ* owner_conv = (LDKCResult_HumanReadableNameDecodeErrorZ*)untag_ptr(owner); + LDKHumanReadableName ret_var = CResult_HumanReadableNameDecodeErrorZ_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_HumanReadableNameDecodeErrorZ_get_err(LDKCResult_HumanReadableNameDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_HumanReadableNameDecodeErrorZ* owner_conv = (LDKCResult_HumanReadableNameDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_HumanReadableNameDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDNSSECQuery C2Tuple_DNSSECQueryDNSResolverContextZ_get_a(LDKC2Tuple_DNSSECQueryDNSResolverContextZ *NONNULL_PTR owner){ + LDKDNSSECQuery ret = owner->a; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSSECQueryDNSResolverContextZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_DNSSECQueryDNSResolverContextZ* owner_conv = (LDKC2Tuple_DNSSECQueryDNSResolverContextZ*)untag_ptr(owner); + LDKDNSSECQuery ret_var = C2Tuple_DNSSECQueryDNSResolverContextZ_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 LDKDNSResolverContext C2Tuple_DNSSECQueryDNSResolverContextZ_get_b(LDKC2Tuple_DNSSECQueryDNSResolverContextZ *NONNULL_PTR owner){ + LDKDNSResolverContext ret = owner->b; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSSECQueryDNSResolverContextZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_DNSSECQueryDNSResolverContextZ* owner_conv = (LDKC2Tuple_DNSSECQueryDNSResolverContextZ*)untag_ptr(owner); + LDKDNSResolverContext ret_var = C2Tuple_DNSSECQueryDNSResolverContextZ_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 LDKC2Tuple_DNSSECQueryDNSResolverContextZ CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_get_ok(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return C2Tuple_DNSSECQueryDNSResolverContextZ_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* owner_conv = (LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ*)untag_ptr(owner); + LDKC2Tuple_DNSSECQueryDNSResolverContextZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSSECQueryDNSResolverContextZ), "LDKC2Tuple_DNSSECQueryDNSResolverContextZ"); + *ret_conv = CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_get_ok(owner_conv); + return tag_ptr(ret_conv, true); +} + +static inline void CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_get_err(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* owner_conv = (LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ*)untag_ptr(owner); + CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_get_err(owner_conv); +} + +static inline struct LDKHumanReadableName C2Tuple_HumanReadableNameThirtyTwoBytesZ_get_a(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ *NONNULL_PTR owner){ + LDKHumanReadableName ret = owner->a; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HumanReadableNameThirtyTwoBytesZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ* owner_conv = (LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)untag_ptr(owner); + LDKHumanReadableName ret_var = C2Tuple_HumanReadableNameThirtyTwoBytesZ_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 LDKThirtyTwoBytes C2Tuple_HumanReadableNameThirtyTwoBytesZ_get_b(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ *NONNULL_PTR owner){ + return ThirtyTwoBytes_clone(&owner->b); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HumanReadableNameThirtyTwoBytesZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ* owner_conv = (LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_HumanReadableNameThirtyTwoBytesZ_get_b(owner_conv).data); + return ret_arr; +} + +static inline LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ_clone(const LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ *orig) { + LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ) * orig->datalen, "LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_get_a(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ *NONNULL_PTR owner){ + return CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ_clone(&owner->a); +} +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ* owner_conv = (LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ*)untag_ptr(owner); + LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ ret_var = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_get_a(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++) { + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ* ret_conv_43_conv = MALLOC(sizeof(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ), "LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ"); + *ret_conv_43_conv = ret_var.data[r]; + ret_arr_ptr[r] = tag_ptr(ret_conv_43_conv, true); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +static inline struct LDKOffer C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_get_b(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ *NONNULL_PTR owner){ + LDKOffer ret = owner->b; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ* owner_conv = (LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ*)untag_ptr(owner); + LDKOffer ret_var = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some_class = NULL; +static jmethodID LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some_meth = NULL; +static jclass LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None_class = NULL; +static jmethodID LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ$Some")); + CHECK(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some_class != NULL); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some_meth != NULL); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ$None")); + CHECK(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None_class != NULL); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None_class, "", "()V"); + CHECK(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ *obj = (LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some: { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ* some_conv = MALLOC(sizeof(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ), "LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone(some_conv); + return (*env)->NewObject(env, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some_class, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_Some_meth, tag_ptr(some_conv, true)); + } + case LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None: { + return (*env)->NewObject(env, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None_class, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_None_meth); + } + default: abort(); + } +} +static inline struct LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_get_a(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ *NONNULL_PTR owner){ + return CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ_clone(&owner->a); +} +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ* owner_conv = (LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ*)untag_ptr(owner); + LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ ret_var = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_get_a(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++) { + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ* ret_conv_43_conv = MALLOC(sizeof(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ), "LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ"); + *ret_conv_43_conv = ret_var.data[r]; + ret_arr_ptr[r] = tag_ptr(ret_conv_43_conv, true); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +static inline struct LDKStr C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_get_b(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ *NONNULL_PTR owner){ + return owner->b; +} +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ* owner_conv = (LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ*)untag_ptr(owner); + LDKStr ret_str = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_get_b(owner_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + return ret_conv; +} + +static jclass LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some_class = NULL; +static jmethodID LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some_meth = NULL; +static jclass LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None_class = NULL; +static jmethodID LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ$Some")); + CHECK(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some_class != NULL); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some_meth != NULL); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ$None")); + CHECK(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None_class != NULL); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None_class, "", "()V"); + CHECK(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ *obj = (LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some: { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ* some_conv = MALLOC(sizeof(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ), "LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone(some_conv); + return (*env)->NewObject(env, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some_class, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_Some_meth, tag_ptr(some_conv, true)); + } + case LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None: { + return (*env)->NewObject(env, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None_class, LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_None_meth); + } + default: abort(); + } +} +static inline struct LDKUnsignedBolt12Invoice CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKUnsignedBolt12Invoice ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedBolt12InvoiceBolt12SemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + LDKUnsignedBolt12Invoice ret_var = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_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 enum LDKBolt12SemanticError CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedBolt12InvoiceBolt12SemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKBolt12SemanticError_to_java(env, CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKBolt12Invoice CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKBolt12Invoice ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceBolt12SemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + LDKBolt12Invoice ret_var = CResult_Bolt12InvoiceBolt12SemanticErrorZ_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 enum LDKBolt12SemanticError CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceBolt12SemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKBolt12SemanticError_to_java(env, CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKSchnorrSignature CResult_SchnorrSignatureNoneZ_get_ok(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SchnorrSignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CResult_SchnorrSignatureNoneZ_get_ok(owner_conv).compact_form); + return ret_arr; +} + +static inline void CResult_SchnorrSignatureNoneZ_get_err(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SchnorrSignatureNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); + CResult_SchnorrSignatureNoneZ_get_err(owner_conv); +} + +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] = BlindedPaymentPath_clone(&orig->data[i]); + } + return ret; +} +static inline LDKCVec_ThirtyTwoBytesZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_ThirtyTwoBytesZ *orig) { + LDKCVec_ThirtyTwoBytesZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_ThirtyTwoBytesZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]); + } + return ret; +} +static jclass LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class = NULL; +static jmethodID LDKCOption_CVec_ThirtyTwoBytesZZ_Some_meth = NULL; +static jclass LDKCOption_CVec_ThirtyTwoBytesZZ_None_class = NULL; +static jmethodID LDKCOption_CVec_ThirtyTwoBytesZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CVec_1ThirtyTwoBytesZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_ThirtyTwoBytesZZ$Some")); + CHECK(LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class != NULL); + LDKCOption_CVec_ThirtyTwoBytesZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class, "", "([[B)V"); + CHECK(LDKCOption_CVec_ThirtyTwoBytesZZ_Some_meth != NULL); + LDKCOption_CVec_ThirtyTwoBytesZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_ThirtyTwoBytesZZ$None")); + CHECK(LDKCOption_CVec_ThirtyTwoBytesZZ_None_class != NULL); + LDKCOption_CVec_ThirtyTwoBytesZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CVec_ThirtyTwoBytesZZ_None_class, "", "()V"); + CHECK(LDKCOption_CVec_ThirtyTwoBytesZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1ThirtyTwoBytesZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_CVec_ThirtyTwoBytesZZ *obj = (LDKCOption_CVec_ThirtyTwoBytesZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_CVec_ThirtyTwoBytesZZ_Some: { + LDKCVec_ThirtyTwoBytesZ some_var = obj->some; + jobjectArray some_arr = NULL; + some_arr = (*env)->NewObjectArray(env, some_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < some_var.datalen; i++) { + int8_tArray some_conv_8_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, some_conv_8_arr, 0, 32, some_var.data[i].data); + (*env)->SetObjectArrayElement(env, some_arr, i, some_conv_8_arr); + } + + return (*env)->NewObject(env, LDKCOption_CVec_ThirtyTwoBytesZZ_Some_class, LDKCOption_CVec_ThirtyTwoBytesZZ_Some_meth, some_arr); + } + case LDKCOption_CVec_ThirtyTwoBytesZZ_None: { + return (*env)->NewObject(env, LDKCOption_CVec_ThirtyTwoBytesZZ_None_class, LDKCOption_CVec_ThirtyTwoBytesZZ_None_meth); + } + default: abort(); + } +} +static jclass LDKAmount_Bitcoin_class = NULL; +static jmethodID LDKAmount_Bitcoin_meth = NULL; +static jclass LDKAmount_Currency_class = NULL; +static jmethodID LDKAmount_Currency_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAmount_init (JNIEnv *env, jclass clz) { + LDKAmount_Bitcoin_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAmount$Bitcoin")); + CHECK(LDKAmount_Bitcoin_class != NULL); + LDKAmount_Bitcoin_meth = (*env)->GetMethodID(env, LDKAmount_Bitcoin_class, "", "(J)V"); + CHECK(LDKAmount_Bitcoin_meth != NULL); + LDKAmount_Currency_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAmount$Currency")); + CHECK(LDKAmount_Currency_class != NULL); + LDKAmount_Currency_meth = (*env)->GetMethodID(env, LDKAmount_Currency_class, "", "([BJ)V"); + CHECK(LDKAmount_Currency_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAmount_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKAmount *obj = (LDKAmount*)untag_ptr(ptr); + switch(obj->tag) { + case LDKAmount_Bitcoin: { + int64_t amount_msats_conv = obj->bitcoin.amount_msats; + return (*env)->NewObject(env, LDKAmount_Bitcoin_class, LDKAmount_Bitcoin_meth, amount_msats_conv); + } + case LDKAmount_Currency: { + int8_tArray iso4217_code_arr = (*env)->NewByteArray(env, 3); + (*env)->SetByteArrayRegion(env, iso4217_code_arr, 0, 3, obj->currency.iso4217_code.data); + int64_t amount_conv = obj->currency.amount; + return (*env)->NewObject(env, LDKAmount_Currency_class, LDKAmount_Currency_meth, iso4217_code_arr, amount_conv); + } + default: abort(); + } +} +static jclass LDKCOption_AmountZ_Some_class = NULL; +static jmethodID LDKCOption_AmountZ_Some_meth = NULL; +static jclass LDKCOption_AmountZ_None_class = NULL; +static jmethodID LDKCOption_AmountZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1AmountZ_init (JNIEnv *env, jclass clz) { + LDKCOption_AmountZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AmountZ$Some")); + CHECK(LDKCOption_AmountZ_Some_class != NULL); + LDKCOption_AmountZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_AmountZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_AmountZ_Some_meth != NULL); + LDKCOption_AmountZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AmountZ$None")); + CHECK(LDKCOption_AmountZ_None_class != NULL); + LDKCOption_AmountZ_None_meth = (*env)->GetMethodID(env, LDKCOption_AmountZ_None_class, "", "()V"); + CHECK(LDKCOption_AmountZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1AmountZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_AmountZ *obj = (LDKCOption_AmountZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_AmountZ_Some: { + int64_t some_ref = tag_ptr(&obj->some, false); + return (*env)->NewObject(env, LDKCOption_AmountZ_Some_class, LDKCOption_AmountZ_Some_meth, some_ref); + } + case LDKCOption_AmountZ_None: { + return (*env)->NewObject(env, LDKCOption_AmountZ_None_class, LDKCOption_AmountZ_None_meth); + } + default: abort(); + } +} +static jclass LDKQuantity_Bounded_class = NULL; +static jmethodID LDKQuantity_Bounded_meth = NULL; +static jclass LDKQuantity_Unbounded_class = NULL; +static jmethodID LDKQuantity_Unbounded_meth = NULL; +static jclass LDKQuantity_One_class = NULL; +static jmethodID LDKQuantity_One_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKQuantity_init (JNIEnv *env, jclass clz) { + LDKQuantity_Bounded_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKQuantity$Bounded")); + CHECK(LDKQuantity_Bounded_class != NULL); + LDKQuantity_Bounded_meth = (*env)->GetMethodID(env, LDKQuantity_Bounded_class, "", "(J)V"); + CHECK(LDKQuantity_Bounded_meth != NULL); + LDKQuantity_Unbounded_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKQuantity$Unbounded")); + CHECK(LDKQuantity_Unbounded_class != NULL); + LDKQuantity_Unbounded_meth = (*env)->GetMethodID(env, LDKQuantity_Unbounded_class, "", "()V"); + CHECK(LDKQuantity_Unbounded_meth != NULL); + LDKQuantity_One_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKQuantity$One")); + CHECK(LDKQuantity_One_class != NULL); + LDKQuantity_One_meth = (*env)->GetMethodID(env, LDKQuantity_One_class, "", "()V"); + CHECK(LDKQuantity_One_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKQuantity_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKQuantity *obj = (LDKQuantity*)untag_ptr(ptr); + switch(obj->tag) { + case LDKQuantity_Bounded: { + int64_t bounded_conv = obj->bounded; + return (*env)->NewObject(env, LDKQuantity_Bounded_class, LDKQuantity_Bounded_meth, bounded_conv); + } + case LDKQuantity_Unbounded: { + return (*env)->NewObject(env, LDKQuantity_Unbounded_class, LDKQuantity_Unbounded_meth); + } + case LDKQuantity_One: { + return (*env)->NewObject(env, LDKQuantity_One_class, LDKQuantity_One_meth); + } + default: abort(); + } +} +static jclass LDKCOption_QuantityZ_Some_class = NULL; +static jmethodID LDKCOption_QuantityZ_Some_meth = NULL; +static jclass LDKCOption_QuantityZ_None_class = NULL; +static jmethodID LDKCOption_QuantityZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1QuantityZ_init (JNIEnv *env, jclass clz) { + LDKCOption_QuantityZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_QuantityZ$Some")); + CHECK(LDKCOption_QuantityZ_Some_class != NULL); + LDKCOption_QuantityZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_QuantityZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_QuantityZ_Some_meth != NULL); + LDKCOption_QuantityZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_QuantityZ$None")); + CHECK(LDKCOption_QuantityZ_None_class != NULL); + LDKCOption_QuantityZ_None_meth = (*env)->GetMethodID(env, LDKCOption_QuantityZ_None_class, "", "()V"); + CHECK(LDKCOption_QuantityZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1QuantityZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_QuantityZ *obj = (LDKCOption_QuantityZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_QuantityZ_Some: { + int64_t some_ref = tag_ptr(&obj->some, false); + return (*env)->NewObject(env, LDKCOption_QuantityZ_Some_class, LDKCOption_QuantityZ_Some_meth, some_ref); + } + case LDKCOption_QuantityZ_None: { + return (*env)->NewObject(env, LDKCOption_QuantityZ_None_class, LDKCOption_QuantityZ_None_meth); + } + default: abort(); + } +} +static inline struct LDKThirtyTwoBytes CResult_ThirtyTwoBytesNoneZ_get_ok(LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return ThirtyTwoBytes_clone(&*owner->contents.result); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ThirtyTwoBytesNoneZ* owner_conv = (LDKCResult_ThirtyTwoBytesNoneZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_ThirtyTwoBytesNoneZ_get_ok(owner_conv).data); + return ret_arr; +} + +static inline void CResult_ThirtyTwoBytesNoneZ_get_err(LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ThirtyTwoBytesNoneZ* owner_conv = (LDKCResult_ThirtyTwoBytesNoneZ*)untag_ptr(owner); + CResult_ThirtyTwoBytesNoneZ_get_err(owner_conv); } static inline struct LDKBolt12Invoice CResult_Bolt12InvoiceDecodeErrorZ_get_ok(LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR owner){ @@ -3476,6 +4017,7 @@ typedef struct LDKEcdsaChannelSigner_JCalls { jmethodID sign_closing_transaction_meth; jmethodID sign_holder_anchor_input_meth; jmethodID sign_channel_announcement_with_funding_key_meth; + jmethodID sign_splicing_funding_input_meth; } LDKEcdsaChannelSigner_JCalls; static void LDKEcdsaChannelSigner_JCalls_free(void* this_arg) { LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg; @@ -3810,6 +4352,37 @@ LDKCResult_ECDSASignatureNoneZ sign_channel_announcement_with_funding_key_LDKEcd } return ret_conv; } +LDKCResult_ECDSASignatureNoneZ sign_splicing_funding_input_LDKEcdsaChannelSigner_jcall(const void* this_arg, LDKTransaction tx, uintptr_t input_index, uint64_t input_value) { + LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_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); + } + LDKTransaction tx_var = tx; + int8_tArray tx_arr = (*env)->NewByteArray(env, tx_var.datalen); + (*env)->SetByteArrayRegion(env, tx_arr, 0, tx_var.datalen, tx_var.data); + Transaction_free(tx_var); + int64_t input_index_conv = input_index; + int64_t input_value_conv = input_value; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_splicing_funding_input_meth, tx_arr, input_index_conv, input_value_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to sign_splicing_funding_input in LDKEcdsaChannelSigner from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_ECDSASignatureNoneZ ret_conv = *(LDKCResult_ECDSASignatureNoneZ*)(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 LDKEcdsaChannelSigner_JCalls_cloned(LDKEcdsaChannelSigner* new_obj) { LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) new_obj->this_arg; atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); @@ -3840,6 +4413,8 @@ static inline LDKEcdsaChannelSigner LDKEcdsaChannelSigner_init (JNIEnv *env, jcl CHECK(calls->sign_holder_anchor_input_meth != NULL); calls->sign_channel_announcement_with_funding_key_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement_with_funding_key", "(J)J"); CHECK(calls->sign_channel_announcement_with_funding_key_meth != NULL); + calls->sign_splicing_funding_input_meth = (*env)->GetMethodID(env, c, "sign_splicing_funding_input", "([BJJ)J"); + CHECK(calls->sign_splicing_funding_input_meth != NULL); LDKChannelPublicKeys pubkeys_conv; pubkeys_conv.inner = untag_ptr(pubkeys); @@ -3857,6 +4432,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, + .sign_splicing_funding_input = sign_splicing_funding_input_LDKEcdsaChannelSigner_jcall, .cloned = LDKEcdsaChannelSigner_JCalls_cloned, .free = LDKEcdsaChannelSigner_JCalls_free, .ChannelSigner = LDKChannelSigner_init(env, clz, ChannelSigner, pubkeys), @@ -4051,6 +4627,20 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1sign_1c return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1sign_1splicing_1funding_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray tx, int64_t input_index, int64_t input_value) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr; + LDKTransaction tx_ref; + tx_ref.datalen = (*env)->GetArrayLength(env, tx); + tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, tx, 0, tx_ref.datalen, tx_ref.data); + tx_ref.data_is_owned = true; + LDKCResult_ECDSASignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ECDSASignatureNoneZ), "LDKCResult_ECDSASignatureNoneZ"); + *ret_conv = (this_arg_conv->sign_splicing_funding_input)(this_arg_conv->this_arg, tx_ref, input_index, input_value); + return tag_ptr(ret_conv, true); +} + static inline struct LDKEcdsaChannelSigner CResult_EcdsaChannelSignerDecodeErrorZ_get_ok(LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return EcdsaChannelSigner_clone(&*owner->contents.result); @@ -5020,13 +5610,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErro return ret_ref; } -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] = BlindedPaymentPath_clone(&orig->data[i]); - } - return ret; -} static inline struct LDKCVec_BlindedPaymentPathZ CResult_CVec_BlindedPaymentPathZNoneZ_get_ok(LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return CVec_BlindedPaymentPathZ_clone(&*owner->contents.result); @@ -5058,67 +5641,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentP CResult_CVec_BlindedPaymentPathZNoneZ_get_err(owner_conv); } -static inline struct LDKOnionMessagePath CResult_OnionMessagePathNoneZ_get_ok(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner){ - LDKOnionMessagePath ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_OnionMessagePathNoneZ* owner_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(owner); - LDKOnionMessagePath ret_var = CResult_OnionMessagePathNoneZ_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_OnionMessagePathNoneZ_get_err(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_OnionMessagePathNoneZ* owner_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(owner); - CResult_OnionMessagePathNoneZ_get_err(owner_conv); -} - -static inline struct LDKCVec_BlindedMessagePathZ CResult_CVec_BlindedMessagePathZNoneZ_get_ok(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return CVec_BlindedMessagePathZ_clone(&*owner->contents.result); -} -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 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_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_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; @@ -6052,188 +6574,6 @@ static inline LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ CVe } return ret; } -static inline struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKInitFeatures ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKInitFeatures ret_var = CResult_InitFeaturesDecodeErrorZ_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_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKChannelFeatures ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKChannelFeatures ret_var = CResult_ChannelFeaturesDecodeErrorZ_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_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKNodeFeatures ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKNodeFeatures ret_var = CResult_NodeFeaturesDecodeErrorZ_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_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKBolt11InvoiceFeatures CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKBolt11InvoiceFeatures ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKBolt11InvoiceFeatures ret_var = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_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_Bolt11InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKBolt12InvoiceFeatures CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKBolt12InvoiceFeatures ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKBolt12InvoiceFeatures ret_var = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_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_Bolt12InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKBlindedHopFeatures CResult_BlindedHopFeaturesDecodeErrorZ_get_ok(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKBlindedHopFeatures ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedHopFeaturesDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKBlindedHopFeatures ret_var = CResult_BlindedHopFeaturesDecodeErrorZ_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_BlindedHopFeaturesDecodeErrorZ_get_err(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedHopFeaturesDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedHopFeaturesDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKChannelTypeFeatures ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKChannelTypeFeatures ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_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_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - static inline struct LDKOfferId CResult_OfferIdDecodeErrorZ_get_ok(LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR owner){ LDKOfferId ret = *owner->contents.result; ret.is_owned = false; @@ -6303,51 +6643,27 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1OfferBolt12Semantic return ret_conv; } -static inline struct LDKInvoiceRequestWithDerivedPayerIdBuilder CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ - LDKInvoiceRequestWithDerivedPayerIdBuilder ret = *owner->contents.result; +static inline struct LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); - LDKInvoiceRequestWithDerivedPayerIdBuilder ret_var = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder ret_var = CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_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 enum LDKBolt12SemanticError CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ +static inline enum LDKBolt12SemanticError CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return Bolt12SemanticError_clone(&*owner->contents.err); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKBolt12SemanticError_to_java(env, CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline struct LDKInvoiceRequestWithExplicitPayerIdBuilder CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ - LDKInvoiceRequestWithExplicitPayerIdBuilder ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); - LDKInvoiceRequestWithExplicitPayerIdBuilder ret_var = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_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 enum LDKBolt12SemanticError CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return Bolt12SemanticError_clone(&*owner->contents.err); -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKBolt12SemanticError_to_java(env, CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err(owner_conv)); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKBolt12SemanticError_to_java(env, CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(owner_conv)); return ret_conv; } @@ -8050,18 +8366,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1UtxoZNoneZ_1get CResult_CVec_UtxoZNoneZ_get_err(owner_conv); } -static jclass LDKPaymentContext_Unknown_class = NULL; -static jmethodID LDKPaymentContext_Unknown_meth = NULL; static jclass LDKPaymentContext_Bolt12Offer_class = NULL; static jmethodID LDKPaymentContext_Bolt12Offer_meth = NULL; static jclass LDKPaymentContext_Bolt12Refund_class = NULL; static jmethodID LDKPaymentContext_Bolt12Refund_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentContext_init (JNIEnv *env, jclass clz) { - LDKPaymentContext_Unknown_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentContext$Unknown")); - CHECK(LDKPaymentContext_Unknown_class != NULL); - LDKPaymentContext_Unknown_meth = (*env)->GetMethodID(env, LDKPaymentContext_Unknown_class, "", "(J)V"); - CHECK(LDKPaymentContext_Unknown_meth != NULL); LDKPaymentContext_Bolt12Offer_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentContext$Bolt12Offer")); CHECK(LDKPaymentContext_Bolt12Offer_class != NULL); @@ -8076,13 +8385,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentContext_init (J JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentContext_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { LDKPaymentContext *obj = (LDKPaymentContext*)untag_ptr(ptr); switch(obj->tag) { - case LDKPaymentContext_Unknown: { - LDKUnknownPaymentContext unknown_var = obj->unknown; - int64_t unknown_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(unknown_var); - unknown_ref = tag_ptr(unknown_var.inner, false); - return (*env)->NewObject(env, LDKPaymentContext_Unknown_class, LDKPaymentContext_Unknown_meth, unknown_ref); - } case LDKPaymentContext_Bolt12Offer: { LDKBolt12OfferContext bolt12_offer_var = obj->bolt12_offer; int64_t bolt12_offer_ref = 0; @@ -8178,6 +8480,87 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1u64u16 default: abort(); } } +static jclass LDKAPIError_APIMisuseError_class = NULL; +static jmethodID LDKAPIError_APIMisuseError_meth = NULL; +static jclass LDKAPIError_FeeRateTooHigh_class = NULL; +static jmethodID LDKAPIError_FeeRateTooHigh_meth = NULL; +static jclass LDKAPIError_InvalidRoute_class = NULL; +static jmethodID LDKAPIError_InvalidRoute_meth = NULL; +static jclass LDKAPIError_ChannelUnavailable_class = NULL; +static jmethodID LDKAPIError_ChannelUnavailable_meth = NULL; +static jclass LDKAPIError_MonitorUpdateInProgress_class = NULL; +static jmethodID LDKAPIError_MonitorUpdateInProgress_meth = NULL; +static jclass LDKAPIError_IncompatibleShutdownScript_class = NULL; +static jmethodID LDKAPIError_IncompatibleShutdownScript_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv *env, jclass clz) { + LDKAPIError_APIMisuseError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$APIMisuseError")); + CHECK(LDKAPIError_APIMisuseError_class != NULL); + LDKAPIError_APIMisuseError_meth = (*env)->GetMethodID(env, LDKAPIError_APIMisuseError_class, "", "(Ljava/lang/String;)V"); + CHECK(LDKAPIError_APIMisuseError_meth != NULL); + LDKAPIError_FeeRateTooHigh_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$FeeRateTooHigh")); + CHECK(LDKAPIError_FeeRateTooHigh_class != NULL); + LDKAPIError_FeeRateTooHigh_meth = (*env)->GetMethodID(env, LDKAPIError_FeeRateTooHigh_class, "", "(Ljava/lang/String;I)V"); + CHECK(LDKAPIError_FeeRateTooHigh_meth != NULL); + LDKAPIError_InvalidRoute_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$InvalidRoute")); + CHECK(LDKAPIError_InvalidRoute_class != NULL); + LDKAPIError_InvalidRoute_meth = (*env)->GetMethodID(env, LDKAPIError_InvalidRoute_class, "", "(Ljava/lang/String;)V"); + CHECK(LDKAPIError_InvalidRoute_meth != NULL); + LDKAPIError_ChannelUnavailable_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$ChannelUnavailable")); + CHECK(LDKAPIError_ChannelUnavailable_class != NULL); + LDKAPIError_ChannelUnavailable_meth = (*env)->GetMethodID(env, LDKAPIError_ChannelUnavailable_class, "", "(Ljava/lang/String;)V"); + CHECK(LDKAPIError_ChannelUnavailable_meth != NULL); + LDKAPIError_MonitorUpdateInProgress_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$MonitorUpdateInProgress")); + CHECK(LDKAPIError_MonitorUpdateInProgress_class != NULL); + LDKAPIError_MonitorUpdateInProgress_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateInProgress_class, "", "()V"); + CHECK(LDKAPIError_MonitorUpdateInProgress_meth != NULL); + LDKAPIError_IncompatibleShutdownScript_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$IncompatibleShutdownScript")); + CHECK(LDKAPIError_IncompatibleShutdownScript_class != NULL); + LDKAPIError_IncompatibleShutdownScript_meth = (*env)->GetMethodID(env, LDKAPIError_IncompatibleShutdownScript_class, "", "(J)V"); + CHECK(LDKAPIError_IncompatibleShutdownScript_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKAPIError_APIMisuseError: { + LDKStr err_str = obj->api_misuse_error.err; + jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); + return (*env)->NewObject(env, LDKAPIError_APIMisuseError_class, LDKAPIError_APIMisuseError_meth, err_conv); + } + case LDKAPIError_FeeRateTooHigh: { + LDKStr err_str = obj->fee_rate_too_high.err; + jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); + int32_t feerate_conv = obj->fee_rate_too_high.feerate; + return (*env)->NewObject(env, LDKAPIError_FeeRateTooHigh_class, LDKAPIError_FeeRateTooHigh_meth, err_conv, feerate_conv); + } + case LDKAPIError_InvalidRoute: { + LDKStr err_str = obj->invalid_route.err; + jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); + return (*env)->NewObject(env, LDKAPIError_InvalidRoute_class, LDKAPIError_InvalidRoute_meth, err_conv); + } + case LDKAPIError_ChannelUnavailable: { + LDKStr err_str = obj->channel_unavailable.err; + jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); + return (*env)->NewObject(env, LDKAPIError_ChannelUnavailable_class, LDKAPIError_ChannelUnavailable_meth, err_conv); + } + case LDKAPIError_MonitorUpdateInProgress: { + return (*env)->NewObject(env, LDKAPIError_MonitorUpdateInProgress_class, LDKAPIError_MonitorUpdateInProgress_meth); + } + case LDKAPIError_IncompatibleShutdownScript: { + LDKShutdownScript script_var = obj->incompatible_shutdown_script.script; + int64_t script_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var); + script_ref = tag_ptr(script_var.inner, false); + return (*env)->NewObject(env, LDKAPIError_IncompatibleShutdownScript_class, LDKAPIError_IncompatibleShutdownScript_meth, script_ref); + } + default: abort(); + } +} static inline struct LDKChannelId CResult_ChannelIdAPIErrorZ_get_ok(LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR owner){ LDKChannelId ret = *owner->contents.result; ret.is_owned = false; @@ -8273,119 +8656,23 @@ static inline LDKCVec_RecentPaymentDetailsZ CVec_RecentPaymentDetailsZ_clone(con } return ret; } -static jclass LDKPaymentSendFailure_ParameterError_class = NULL; -static jmethodID LDKPaymentSendFailure_ParameterError_meth = NULL; -static jclass LDKPaymentSendFailure_PathParameterError_class = NULL; -static jmethodID LDKPaymentSendFailure_PathParameterError_meth = NULL; -static jclass LDKPaymentSendFailure_AllFailedResendSafe_class = NULL; -static jmethodID LDKPaymentSendFailure_AllFailedResendSafe_meth = NULL; -static jclass LDKPaymentSendFailure_DuplicatePayment_class = NULL; -static jmethodID LDKPaymentSendFailure_DuplicatePayment_meth = NULL; -static jclass LDKPaymentSendFailure_PartialFailure_class = NULL; -static jmethodID LDKPaymentSendFailure_PartialFailure_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentSendFailure_init (JNIEnv *env, jclass clz) { - LDKPaymentSendFailure_ParameterError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$ParameterError")); - CHECK(LDKPaymentSendFailure_ParameterError_class != NULL); - LDKPaymentSendFailure_ParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_ParameterError_class, "", "(J)V"); - CHECK(LDKPaymentSendFailure_ParameterError_meth != NULL); - LDKPaymentSendFailure_PathParameterError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$PathParameterError")); - CHECK(LDKPaymentSendFailure_PathParameterError_class != NULL); - LDKPaymentSendFailure_PathParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PathParameterError_class, "", "([J)V"); - CHECK(LDKPaymentSendFailure_PathParameterError_meth != NULL); - LDKPaymentSendFailure_AllFailedResendSafe_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$AllFailedResendSafe")); - CHECK(LDKPaymentSendFailure_AllFailedResendSafe_class != NULL); - LDKPaymentSendFailure_AllFailedResendSafe_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_AllFailedResendSafe_class, "", "([J)V"); - CHECK(LDKPaymentSendFailure_AllFailedResendSafe_meth != NULL); - LDKPaymentSendFailure_DuplicatePayment_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$DuplicatePayment")); - CHECK(LDKPaymentSendFailure_DuplicatePayment_class != NULL); - LDKPaymentSendFailure_DuplicatePayment_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_DuplicatePayment_class, "", "()V"); - CHECK(LDKPaymentSendFailure_DuplicatePayment_meth != NULL); - LDKPaymentSendFailure_PartialFailure_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$PartialFailure")); - CHECK(LDKPaymentSendFailure_PartialFailure_class != NULL); - LDKPaymentSendFailure_PartialFailure_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PartialFailure_class, "", "([JJ[B)V"); - CHECK(LDKPaymentSendFailure_PartialFailure_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr); - switch(obj->tag) { - case LDKPaymentSendFailure_ParameterError: { - int64_t parameter_error_ref = tag_ptr(&obj->parameter_error, false); - return (*env)->NewObject(env, LDKPaymentSendFailure_ParameterError_class, LDKPaymentSendFailure_ParameterError_meth, parameter_error_ref); - } - case LDKPaymentSendFailure_PathParameterError: { - LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error; - int64_tArray path_parameter_error_arr = NULL; - path_parameter_error_arr = (*env)->NewLongArray(env, path_parameter_error_var.datalen); - int64_t *path_parameter_error_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_parameter_error_arr, NULL); - for (size_t w = 0; w < path_parameter_error_var.datalen; w++) { - LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *path_parameter_error_conv_22_conv = path_parameter_error_var.data[w]; - *path_parameter_error_conv_22_conv = CResult_NoneAPIErrorZ_clone(path_parameter_error_conv_22_conv); - path_parameter_error_arr_ptr[w] = tag_ptr(path_parameter_error_conv_22_conv, true); - } - (*env)->ReleasePrimitiveArrayCritical(env, path_parameter_error_arr, path_parameter_error_arr_ptr, 0); - return (*env)->NewObject(env, LDKPaymentSendFailure_PathParameterError_class, LDKPaymentSendFailure_PathParameterError_meth, path_parameter_error_arr); - } - case LDKPaymentSendFailure_AllFailedResendSafe: { - LDKCVec_APIErrorZ all_failed_resend_safe_var = obj->all_failed_resend_safe; - int64_tArray all_failed_resend_safe_arr = NULL; - all_failed_resend_safe_arr = (*env)->NewLongArray(env, all_failed_resend_safe_var.datalen); - int64_t *all_failed_resend_safe_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, all_failed_resend_safe_arr, NULL); - for (size_t k = 0; k < all_failed_resend_safe_var.datalen; k++) { - int64_t all_failed_resend_safe_conv_10_ref = tag_ptr(&all_failed_resend_safe_var.data[k], false); - all_failed_resend_safe_arr_ptr[k] = all_failed_resend_safe_conv_10_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, all_failed_resend_safe_arr, all_failed_resend_safe_arr_ptr, 0); - return (*env)->NewObject(env, LDKPaymentSendFailure_AllFailedResendSafe_class, LDKPaymentSendFailure_AllFailedResendSafe_meth, all_failed_resend_safe_arr); - } - case LDKPaymentSendFailure_DuplicatePayment: { - return (*env)->NewObject(env, LDKPaymentSendFailure_DuplicatePayment_class, LDKPaymentSendFailure_DuplicatePayment_meth); - } - case LDKPaymentSendFailure_PartialFailure: { - LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results; - int64_tArray results_arr = NULL; - results_arr = (*env)->NewLongArray(env, results_var.datalen); - int64_t *results_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, results_arr, NULL); - for (size_t w = 0; w < results_var.datalen; w++) { - LDKCResult_NoneAPIErrorZ* results_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *results_conv_22_conv = results_var.data[w]; - *results_conv_22_conv = CResult_NoneAPIErrorZ_clone(results_conv_22_conv); - results_arr_ptr[w] = tag_ptr(results_conv_22_conv, true); - } - (*env)->ReleasePrimitiveArrayCritical(env, results_arr, results_arr_ptr, 0); - LDKRouteParameters failed_paths_retry_var = obj->partial_failure.failed_paths_retry; - int64_t failed_paths_retry_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var); - failed_paths_retry_ref = tag_ptr(failed_paths_retry_var.inner, false); - int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->partial_failure.payment_id.data); - return (*env)->NewObject(env, LDKPaymentSendFailure_PartialFailure_class, LDKPaymentSendFailure_PartialFailure_meth, results_arr, failed_paths_retry_ref, payment_id_arr); - } - default: abort(); - } -} -static inline void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){ +static inline void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return *owner->contents.result; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner); - CResult_NonePaymentSendFailureZ_get_ok(owner_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner); + CResult_NoneAPIErrorZ_get_ok(owner_conv); } -static inline struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){ +static inline struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return PaymentSendFailure_clone(&*owner->contents.err); + return APIError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = CResult_NoneAPIErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -8409,25 +8696,101 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFa return ret_conv; } -static inline struct LDKThirtyTwoBytes CResult_ThirtyTwoBytesPaymentSendFailureZ_get_ok(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR owner){ +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 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(); + } +} +static inline void CResult_NoneBolt12PaymentErrorZ_get_ok(LDKCResult_NoneBolt12PaymentErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return ThirtyTwoBytes_clone(&*owner->contents.result); + return *owner->contents.result; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* owner_conv = (LDKCResult_ThirtyTwoBytesPaymentSendFailureZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_ThirtyTwoBytesPaymentSendFailureZ_get_ok(owner_conv).data); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneBolt12PaymentErrorZ* owner_conv = (LDKCResult_NoneBolt12PaymentErrorZ*)untag_ptr(owner); + CResult_NoneBolt12PaymentErrorZ_get_ok(owner_conv); } -static inline struct LDKPaymentSendFailure CResult_ThirtyTwoBytesPaymentSendFailureZ_get_err(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR owner){ +static inline struct LDKBolt12PaymentError CResult_NoneBolt12PaymentErrorZ_get_err(LDKCResult_NoneBolt12PaymentErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return PaymentSendFailure_clone(&*owner->contents.err); + return Bolt12PaymentError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* owner_conv = (LDKCResult_ThirtyTwoBytesPaymentSendFailureZ*)untag_ptr(owner); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = CResult_ThirtyTwoBytesPaymentSendFailureZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneBolt12PaymentErrorZ* owner_conv = (LDKCResult_NoneBolt12PaymentErrorZ*)untag_ptr(owner); + LDKBolt12PaymentError *ret_copy = MALLOC(sizeof(LDKBolt12PaymentError), "LDKBolt12PaymentError"); + *ret_copy = CResult_NoneBolt12PaymentErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -8473,25 +8836,64 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ThirtyTwoBytes return ret_arr; } -static inline struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_get_ok(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR owner){ +static jclass LDKProbeSendFailure_RouteNotFound_class = NULL; +static jmethodID LDKProbeSendFailure_RouteNotFound_meth = NULL; +static jclass LDKProbeSendFailure_ParameterError_class = NULL; +static jmethodID LDKProbeSendFailure_ParameterError_meth = NULL; +static jclass LDKProbeSendFailure_DuplicateProbe_class = NULL; +static jmethodID LDKProbeSendFailure_DuplicateProbe_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKProbeSendFailure_init (JNIEnv *env, jclass clz) { + LDKProbeSendFailure_RouteNotFound_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKProbeSendFailure$RouteNotFound")); + CHECK(LDKProbeSendFailure_RouteNotFound_class != NULL); + LDKProbeSendFailure_RouteNotFound_meth = (*env)->GetMethodID(env, LDKProbeSendFailure_RouteNotFound_class, "", "()V"); + CHECK(LDKProbeSendFailure_RouteNotFound_meth != NULL); + LDKProbeSendFailure_ParameterError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKProbeSendFailure$ParameterError")); + CHECK(LDKProbeSendFailure_ParameterError_class != NULL); + LDKProbeSendFailure_ParameterError_meth = (*env)->GetMethodID(env, LDKProbeSendFailure_ParameterError_class, "", "(J)V"); + CHECK(LDKProbeSendFailure_ParameterError_meth != NULL); + LDKProbeSendFailure_DuplicateProbe_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKProbeSendFailure$DuplicateProbe")); + CHECK(LDKProbeSendFailure_DuplicateProbe_class != NULL); + LDKProbeSendFailure_DuplicateProbe_meth = (*env)->GetMethodID(env, LDKProbeSendFailure_DuplicateProbe_class, "", "()V"); + CHECK(LDKProbeSendFailure_DuplicateProbe_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKProbeSendFailure_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKProbeSendFailure *obj = (LDKProbeSendFailure*)untag_ptr(ptr); + switch(obj->tag) { + case LDKProbeSendFailure_RouteNotFound: { + return (*env)->NewObject(env, LDKProbeSendFailure_RouteNotFound_class, LDKProbeSendFailure_RouteNotFound_meth); + } + case LDKProbeSendFailure_ParameterError: { + int64_t parameter_error_ref = tag_ptr(&obj->parameter_error, false); + return (*env)->NewObject(env, LDKProbeSendFailure_ParameterError_class, LDKProbeSendFailure_ParameterError_meth, parameter_error_ref); + } + case LDKProbeSendFailure_DuplicateProbe: { + return (*env)->NewObject(env, LDKProbeSendFailure_DuplicateProbe_class, LDKProbeSendFailure_DuplicateProbe_meth); + } + default: abort(); + } +} +static inline struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_get_ok(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone(&*owner->contents.result); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* owner_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ*)untag_ptr(owner); LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ), "LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ"); - *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_get_ok(owner_conv); + *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_get_ok(owner_conv); return tag_ptr(ret_conv, true); } -static inline struct LDKPaymentSendFailure CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_get_err(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR owner){ +static inline struct LDKProbeSendFailure CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_get_err(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return PaymentSendFailure_clone(&*owner->contents.err); + return ProbeSendFailure_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ*)untag_ptr(owner); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* owner_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ*)untag_ptr(owner); + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -8503,35 +8905,6 @@ static inline LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ CVec_C2Tuple_Thirty } return ret; } -static jclass LDKProbeSendFailure_RouteNotFound_class = NULL; -static jmethodID LDKProbeSendFailure_RouteNotFound_meth = NULL; -static jclass LDKProbeSendFailure_SendingFailed_class = NULL; -static jmethodID LDKProbeSendFailure_SendingFailed_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKProbeSendFailure_init (JNIEnv *env, jclass clz) { - LDKProbeSendFailure_RouteNotFound_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKProbeSendFailure$RouteNotFound")); - CHECK(LDKProbeSendFailure_RouteNotFound_class != NULL); - LDKProbeSendFailure_RouteNotFound_meth = (*env)->GetMethodID(env, LDKProbeSendFailure_RouteNotFound_class, "", "()V"); - CHECK(LDKProbeSendFailure_RouteNotFound_meth != NULL); - LDKProbeSendFailure_SendingFailed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKProbeSendFailure$SendingFailed")); - CHECK(LDKProbeSendFailure_SendingFailed_class != NULL); - LDKProbeSendFailure_SendingFailed_meth = (*env)->GetMethodID(env, LDKProbeSendFailure_SendingFailed_class, "", "(J)V"); - CHECK(LDKProbeSendFailure_SendingFailed_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKProbeSendFailure_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKProbeSendFailure *obj = (LDKProbeSendFailure*)untag_ptr(ptr); - switch(obj->tag) { - case LDKProbeSendFailure_RouteNotFound: { - return (*env)->NewObject(env, LDKProbeSendFailure_RouteNotFound_class, LDKProbeSendFailure_RouteNotFound_meth); - } - case LDKProbeSendFailure_SendingFailed: { - int64_t sending_failed_ref = tag_ptr(&obj->sending_failed, false); - return (*env)->NewObject(env, LDKProbeSendFailure_SendingFailed_class, LDKProbeSendFailure_SendingFailed_meth, sending_failed_ref); - } - default: abort(); - } -} static inline struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_get_ok(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ_clone(&*owner->contents.result); @@ -8602,6 +8975,116 @@ static inline LDKCVec_ChannelIdZ CVec_ChannelIdZ_clone(const LDKCVec_ChannelIdZ } return ret; } +static inline struct LDKPublicKey C2Tuple_PublicKeyChannelIdZ_get_a(LDKC2Tuple_PublicKeyChannelIdZ *NONNULL_PTR owner){ + return owner->a; +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyChannelIdZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_PublicKeyChannelIdZ* owner_conv = (LDKC2Tuple_PublicKeyChannelIdZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, C2Tuple_PublicKeyChannelIdZ_get_a(owner_conv).compressed_form); + return ret_arr; +} + +static inline struct LDKChannelId C2Tuple_PublicKeyChannelIdZ_get_b(LDKC2Tuple_PublicKeyChannelIdZ *NONNULL_PTR owner){ + LDKChannelId ret = owner->b; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyChannelIdZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_PublicKeyChannelIdZ* owner_conv = (LDKC2Tuple_PublicKeyChannelIdZ*)untag_ptr(owner); + LDKChannelId ret_var = C2Tuple_PublicKeyChannelIdZ_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_PublicKeyChannelIdZZ_Some_class = NULL; +static jmethodID LDKCOption_C2Tuple_PublicKeyChannelIdZZ_Some_meth = NULL; +static jclass LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None_class = NULL; +static jmethodID LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1PublicKeyChannelIdZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_PublicKeyChannelIdZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_PublicKeyChannelIdZZ$Some")); + CHECK(LDKCOption_C2Tuple_PublicKeyChannelIdZZ_Some_class != NULL); + LDKCOption_C2Tuple_PublicKeyChannelIdZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_PublicKeyChannelIdZZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_C2Tuple_PublicKeyChannelIdZZ_Some_meth != NULL); + LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_PublicKeyChannelIdZZ$None")); + CHECK(LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None_class != NULL); + LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None_class, "", "()V"); + CHECK(LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1PublicKeyChannelIdZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_C2Tuple_PublicKeyChannelIdZZ *obj = (LDKCOption_C2Tuple_PublicKeyChannelIdZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_C2Tuple_PublicKeyChannelIdZZ_Some: { + LDKC2Tuple_PublicKeyChannelIdZ* some_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyChannelIdZ), "LDKC2Tuple_PublicKeyChannelIdZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_PublicKeyChannelIdZ_clone(some_conv); + return (*env)->NewObject(env, LDKCOption_C2Tuple_PublicKeyChannelIdZZ_Some_class, LDKCOption_C2Tuple_PublicKeyChannelIdZZ_Some_meth, tag_ptr(some_conv, true)); + } + case LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None: { + return (*env)->NewObject(env, LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None_class, LDKCOption_C2Tuple_PublicKeyChannelIdZZ_None_meth); + } + default: abort(); + } +} +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 inline struct LDKOfferWithDerivedMetadataBuilder CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ LDKOfferWithDerivedMetadataBuilder ret = *owner->contents.result; ret.is_owned = false; @@ -8656,6 +9139,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1StrZ_1ref_1from default: abort(); } } +static inline LDKCVec_DestinationZ CVec_DestinationZ_clone(const LDKCVec_DestinationZ *orig) { + LDKCVec_DestinationZ ret = { .data = MALLOC(sizeof(LDKDestination) * orig->datalen, "LDKCVec_DestinationZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = Destination_clone(&orig->data[i]); + } + return ret; +} static inline struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_get_ok(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone(&*owner->contents.result); @@ -8699,87 +9189,6 @@ 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; @@ -8886,132 +9295,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1Offers default: abort(); } } -static jclass LDKDestination_Node_class = NULL; -static jmethodID LDKDestination_Node_meth = NULL; -static jclass LDKDestination_BlindedPath_class = NULL; -static jmethodID LDKDestination_BlindedPath_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDestination_init (JNIEnv *env, jclass clz) { - LDKDestination_Node_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$Node")); - CHECK(LDKDestination_Node_class != NULL); - LDKDestination_Node_meth = (*env)->GetMethodID(env, LDKDestination_Node_class, "", "([B)V"); - CHECK(LDKDestination_Node_meth != NULL); - LDKDestination_BlindedPath_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$BlindedPath")); - CHECK(LDKDestination_BlindedPath_class != NULL); - LDKDestination_BlindedPath_meth = (*env)->GetMethodID(env, LDKDestination_BlindedPath_class, "", "(J)V"); - CHECK(LDKDestination_BlindedPath_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKDestination *obj = (LDKDestination*)untag_ptr(ptr); - switch(obj->tag) { - case LDKDestination_Node: { - int8_tArray node_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, node_arr, 0, 33, obj->node.compressed_form); - return (*env)->NewObject(env, LDKDestination_Node_class, LDKDestination_Node_meth, node_arr); - } - case LDKDestination_BlindedPath: { - 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); - return (*env)->NewObject(env, LDKDestination_BlindedPath_class, LDKDestination_BlindedPath_meth, blinded_path_ref); - } - default: abort(); - } -} -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); } @@ -9237,7 +9520,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPendingHTLCRouting_ini LDKPendingHTLCRouting_ReceiveKeysend_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPendingHTLCRouting$ReceiveKeysend")); CHECK(LDKPendingHTLCRouting_ReceiveKeysend_class != NULL); - LDKPendingHTLCRouting_ReceiveKeysend_meth = (*env)->GetMethodID(env, LDKPendingHTLCRouting_ReceiveKeysend_class, "", "(J[BJI[JZ)V"); + LDKPendingHTLCRouting_ReceiveKeysend_meth = (*env)->GetMethodID(env, LDKPendingHTLCRouting_ReceiveKeysend_class, "", "(J[BJI[JZZ)V"); CHECK(LDKPendingHTLCRouting_ReceiveKeysend_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPendingHTLCRouting_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { @@ -9300,7 +9583,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPendingHTLCRouting_1ref_ } (*env)->ReleasePrimitiveArrayCritical(env, custom_tlvs_arr, custom_tlvs_arr_ptr, 0); jboolean requires_blinded_error_conv = obj->receive_keysend.requires_blinded_error; - return (*env)->NewObject(env, LDKPendingHTLCRouting_ReceiveKeysend_class, LDKPendingHTLCRouting_ReceiveKeysend_meth, payment_data_ref, payment_preimage_arr, payment_metadata_ref, incoming_cltv_expiry_conv, custom_tlvs_arr, requires_blinded_error_conv); + jboolean has_recipient_created_payment_secret_conv = obj->receive_keysend.has_recipient_created_payment_secret; + return (*env)->NewObject(env, LDKPendingHTLCRouting_ReceiveKeysend_class, LDKPendingHTLCRouting_ReceiveKeysend_meth, payment_data_ref, payment_preimage_arr, payment_metadata_ref, incoming_cltv_expiry_conv, custom_tlvs_arr, requires_blinded_error_conv, has_recipient_created_payment_secret_conv); } default: abort(); } @@ -9837,11 +10121,10 @@ typedef struct LDKNodeSigner_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; - jmethodID get_inbound_payment_key_material_meth; + jmethodID get_inbound_payment_key_meth; jmethodID get_node_id_meth; jmethodID ecdh_meth; jmethodID sign_invoice_meth; - jmethodID sign_bolt12_invoice_request_meth; jmethodID sign_bolt12_invoice_meth; jmethodID sign_gossip_message_meth; } LDKNodeSigner_JCalls; @@ -9862,7 +10145,7 @@ static void LDKNodeSigner_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKThirtyTwoBytes get_inbound_payment_key_material_LDKNodeSigner_jcall(const void* this_arg) { +LDKExpandedKey get_inbound_payment_key_LDKNodeSigner_jcall(const void* this_arg) { 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); @@ -9873,18 +10156,19 @@ LDKThirtyTwoBytes get_inbound_payment_key_material_LDKNodeSigner_jcall(const voi } jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_inbound_payment_key_material_meth); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_inbound_payment_key_meth); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to get_inbound_payment_key_material in LDKNodeSigner from rust threw an exception."); + (*env)->FatalError(env, "A call to get_inbound_payment_key in LDKNodeSigner from rust threw an exception."); } - LDKThirtyTwoBytes ret_ref; - CHECK((*env)->GetArrayLength(env, ret) == 32); - (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data); + LDKExpandedKey ret_conv; + ret_conv.inner = untag_ptr(ret); + ret_conv.is_owned = ptr_is_owned(ret); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } - return ret_ref; + return ret_conv; } LDKCResult_PublicKeyNoneZ get_node_id_LDKNodeSigner_jcall(const void* this_arg, LDKRecipient recipient) { LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; @@ -9974,36 +10258,6 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKNodeSigner_jcall(const void } return ret_conv; } -LDKCResult_SchnorrSignatureNoneZ sign_bolt12_invoice_request_LDKNodeSigner_jcall(const void* this_arg, const LDKUnsignedInvoiceRequest * invoice_request) { - 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); - 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); - } - LDKUnsignedInvoiceRequest invoice_request_var = *invoice_request; - int64_t invoice_request_ref = 0; - invoice_request_var = UnsignedInvoiceRequest_clone(&invoice_request_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_request_var); - invoice_request_ref = tag_ptr(invoice_request_var.inner, invoice_request_var.is_owned); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_bolt12_invoice_request_meth, invoice_request_ref); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to sign_bolt12_invoice_request in LDKNodeSigner from rust threw an exception."); - } - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_SchnorrSignatureNoneZ ret_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(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_SchnorrSignatureNoneZ sign_bolt12_invoice_LDKNodeSigner_jcall(const void* this_arg, const LDKUnsignedBolt12Invoice * invoice) { LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; JNIEnv *env; @@ -10073,16 +10327,14 @@ static inline LDKNodeSigner LDKNodeSigner_init (JNIEnv *env, jclass clz, jobject atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->get_inbound_payment_key_material_meth = (*env)->GetMethodID(env, c, "get_inbound_payment_key_material", "()[B"); - CHECK(calls->get_inbound_payment_key_material_meth != NULL); + calls->get_inbound_payment_key_meth = (*env)->GetMethodID(env, c, "get_inbound_payment_key", "()J"); + CHECK(calls->get_inbound_payment_key_meth != NULL); calls->get_node_id_meth = (*env)->GetMethodID(env, c, "get_node_id", "(Lorg/ldk/enums/Recipient;)J"); 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", "(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); calls->sign_bolt12_invoice_meth = (*env)->GetMethodID(env, c, "sign_bolt12_invoice", "(J)J"); CHECK(calls->sign_bolt12_invoice_meth != NULL); calls->sign_gossip_message_meth = (*env)->GetMethodID(env, c, "sign_gossip_message", "(J)J"); @@ -10090,11 +10342,10 @@ static inline LDKNodeSigner LDKNodeSigner_init (JNIEnv *env, jclass clz, jobject LDKNodeSigner ret = { .this_arg = (void*) calls, - .get_inbound_payment_key_material = get_inbound_payment_key_material_LDKNodeSigner_jcall, + .get_inbound_payment_key = get_inbound_payment_key_LDKNodeSigner_jcall, .get_node_id = get_node_id_LDKNodeSigner_jcall, .ecdh = ecdh_LDKNodeSigner_jcall, .sign_invoice = sign_invoice_LDKNodeSigner_jcall, - .sign_bolt12_invoice_request = sign_bolt12_invoice_request_LDKNodeSigner_jcall, .sign_bolt12_invoice = sign_bolt12_invoice_LDKNodeSigner_jcall, .sign_gossip_message = sign_gossip_message_LDKNodeSigner_jcall, .free = LDKNodeSigner_JCalls_free, @@ -10106,13 +10357,15 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKNodeSigner_1new(JNIEnv * *res_ptr = LDKNodeSigner_init(env, clz, o); return tag_ptr(res_ptr, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeSigner_1get_1inbound_1payment_1key_1material(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1get_1inbound_1payment_1key(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); } LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data); - return ret_arr; + LDKExpandedKey ret_var = (this_arg_conv->get_inbound_payment_key)(this_arg_conv->this_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg, jclass recipient) { @@ -10157,20 +10410,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1sign_1invoice(J return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1sign_1bolt12_1invoice_1request(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice_request) { - 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; - LDKUnsignedInvoiceRequest invoice_request_conv; - invoice_request_conv.inner = untag_ptr(invoice_request); - invoice_request_conv.is_owned = ptr_is_owned(invoice_request); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_request_conv); - invoice_request_conv.is_owned = false; - LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); - *ret_conv = (this_arg_conv->sign_bolt12_invoice_request)(this_arg_conv->this_arg, &invoice_request_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1sign_1bolt12_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -10537,6 +10776,403 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1get_1est_1sat return ret_conv; } +typedef struct LDKRouter_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID find_route_meth; + jmethodID find_route_with_id_meth; + jmethodID create_blinded_payment_paths_meth; +} LDKRouter_JCalls; +static void LDKRouter_JCalls_free(void* this_arg) { + LDKRouter_JCalls *j_calls = (LDKRouter_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); + } +} +LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, LDKCVec_ChannelDetailsZ * first_hops, LDKInFlightHtlcs inflight_htlcs) { + 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); + 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 payer_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, payer_arr, 0, 33, payer.compressed_form); + LDKRouteParameters route_params_var = *route_params; + int64_t route_params_ref = 0; + route_params_var = RouteParameters_clone(&route_params_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var); + route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned); + LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops; + int64_tArray first_hops_arr = NULL; + if (first_hops != NULL) { + LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr; + first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen); + int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL); + for (size_t q = 0; q < first_hops_var.datalen; q++) { + LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q]; + int64_t first_hops_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); + first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned); + first_hops_arr_ptr[q] = first_hops_conv_16_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0); + } + LDKInFlightHtlcs inflight_htlcs_var = inflight_htlcs; + int64_t inflight_htlcs_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var); + inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_meth, payer_arr, route_params_ref, first_hops_arr, inflight_htlcs_ref); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to find_route in LDKRouter from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(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_RouteLightningErrorZ find_route_with_id_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, LDKCVec_ChannelDetailsZ * first_hops, LDKInFlightHtlcs inflight_htlcs, LDKThirtyTwoBytes _payment_hash, LDKThirtyTwoBytes _payment_id) { + 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); + 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 payer_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, payer_arr, 0, 33, payer.compressed_form); + LDKRouteParameters route_params_var = *route_params; + int64_t route_params_ref = 0; + route_params_var = RouteParameters_clone(&route_params_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var); + route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned); + LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops; + int64_tArray first_hops_arr = NULL; + if (first_hops != NULL) { + LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr; + first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen); + int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL); + for (size_t q = 0; q < first_hops_var.datalen; q++) { + LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q]; + int64_t first_hops_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); + first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned); + first_hops_arr_ptr[q] = first_hops_conv_16_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0); + } + LDKInFlightHtlcs inflight_htlcs_var = inflight_htlcs; + int64_t inflight_htlcs_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var); + inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned); + int8_tArray _payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, _payment_hash_arr, 0, 32, _payment_hash.data); + int8_tArray _payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, _payment_id_arr, 0, 32, _payment_id.data); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_with_id_meth, payer_arr, route_params_ref, first_hops_arr, inflight_htlcs_ref, _payment_hash_arr, _payment_id_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to find_route_with_id in LDKRouter from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(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_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); + 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); + LDKCVec_ChannelDetailsZ first_hops_var = first_hops; + int64_tArray first_hops_arr = NULL; + first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen); + int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL); + for (size_t q = 0; q < first_hops_var.datalen; q++) { + LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q]; + int64_t first_hops_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); + first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned); + first_hops_arr_ptr[q] = first_hops_conv_16_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0); + FREE(first_hops_var.data); + LDKReceiveTlvs tlvs_var = tlvs; + int64_t tlvs_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_var); + tlvs_ref = tag_ptr(tlvs_var.inner, tlvs_var.is_owned); + int64_t amount_msats_conv = amount_msats; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->create_blinded_payment_paths_meth, recipient_arr, first_hops_arr, tlvs_ref, amount_msats_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to create_blinded_payment_paths in LDKRouter from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(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); + } + return ret_conv; +} +static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) { + LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKRouter LDKRouter_init (JNIEnv *env, jclass clz, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->find_route_meth = (*env)->GetMethodID(env, c, "find_route", "([BJ[JJ)J"); + CHECK(calls->find_route_meth != NULL); + calls->find_route_with_id_meth = (*env)->GetMethodID(env, c, "find_route_with_id", "([BJ[JJ[B[B)J"); + CHECK(calls->find_route_with_id_meth != NULL); + calls->create_blinded_payment_paths_meth = (*env)->GetMethodID(env, c, "create_blinded_payment_paths", "([B[JJJ)J"); + CHECK(calls->create_blinded_payment_paths_meth != NULL); + + LDKRouter ret = { + .this_arg = (void*) calls, + .find_route = find_route_LDKRouter_jcall, + .find_route_with_id = find_route_with_id_LDKRouter_jcall, + .create_blinded_payment_paths = create_blinded_payment_paths_LDKRouter_jcall, + .free = LDKRouter_JCalls_free, + }; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRouter_1new(JNIEnv *env, jclass clz, jobject o) { + LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter"); + *res_ptr = LDKRouter_init(env, clz, o); + return tag_ptr(res_ptr, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t route_params, int64_tArray first_hops, int64_t inflight_htlcs) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr; + LDKPublicKey payer_ref; + CHECK((*env)->GetArrayLength(env, payer) == 33); + (*env)->GetByteArrayRegion(env, payer, 0, 33, payer_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; + 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; + } + 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 = InFlightHtlcs_clone(&inflight_htlcs_conv); + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, &route_params_conv, first_hops_ptr, inflight_htlcs_conv); + if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route_1with_1id(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t route_params, int64_tArray first_hops, int64_t inflight_htlcs, int8_tArray _payment_hash, int8_tArray _payment_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr; + LDKPublicKey payer_ref; + CHECK((*env)->GetArrayLength(env, payer) == 33); + (*env)->GetByteArrayRegion(env, payer, 0, 33, payer_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; + 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; + } + 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 = InFlightHtlcs_clone(&inflight_htlcs_conv); + LDKThirtyTwoBytes _payment_hash_ref; + CHECK((*env)->GetArrayLength(env, _payment_hash) == 32); + (*env)->GetByteArrayRegion(env, _payment_hash, 0, 32, _payment_hash_ref.data); + LDKThirtyTwoBytes _payment_id_ref; + CHECK((*env)->GetArrayLength(env, _payment_id) == 32); + (*env)->GetByteArrayRegion(env, _payment_id, 0, 32, _payment_id_ref.data); + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = (this_arg_conv->find_route_with_id)(this_arg_conv->this_arg, payer_ref, &route_params_conv, first_hops_ptr, inflight_htlcs_conv, _payment_hash_ref, _payment_id_ref); + if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1create_1blinded_1payment_1paths(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray recipient, int64_tArray first_hops, int64_t tlvs, int64_t amount_msats) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr; + LDKPublicKey recipient_ref; + CHECK((*env)->GetArrayLength(env, recipient) == 33); + (*env)->GetByteArrayRegion(env, recipient, 0, 33, recipient_ref.compressed_form); + LDKCVec_ChannelDetailsZ first_hops_constr; + 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 = ChannelDetails_clone(&first_hops_conv_16_conv); + first_hops_constr.data[q] = first_hops_conv_16_conv; + } + (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0); + LDKReceiveTlvs tlvs_conv; + tlvs_conv.inner = untag_ptr(tlvs); + tlvs_conv.is_owned = ptr_is_owned(tlvs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_conv); + tlvs_conv = ReceiveTlvs_clone(&tlvs_conv); + 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); +} + +static inline struct LDKOnionMessagePath CResult_OnionMessagePathNoneZ_get_ok(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner){ + LDKOnionMessagePath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_OnionMessagePathNoneZ* owner_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(owner); + LDKOnionMessagePath ret_var = CResult_OnionMessagePathNoneZ_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_OnionMessagePathNoneZ_get_err(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_OnionMessagePathNoneZ* owner_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(owner); + CResult_OnionMessagePathNoneZ_get_err(owner_conv); +} + +static inline struct LDKCVec_BlindedMessagePathZ CResult_CVec_BlindedMessagePathZNoneZ_get_ok(LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return CVec_BlindedMessagePathZ_clone(&*owner->contents.result); +} +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 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_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_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; +} typedef struct LDKMessageRouter_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -10810,350 +11446,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageRouter_1create_1comp return tag_ptr(ret_conv, true); } -typedef struct LDKRouter_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - LDKMessageRouter_JCalls* MessageRouter; - jmethodID find_route_meth; - jmethodID find_route_with_id_meth; - jmethodID create_blinded_payment_paths_meth; -} LDKRouter_JCalls; -static void LDKRouter_JCalls_free(void* this_arg) { - LDKRouter_JCalls *j_calls = (LDKRouter_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); - } -} -LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, LDKCVec_ChannelDetailsZ * first_hops, LDKInFlightHtlcs inflight_htlcs) { - 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); - 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 payer_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, payer_arr, 0, 33, payer.compressed_form); - LDKRouteParameters route_params_var = *route_params; - int64_t route_params_ref = 0; - route_params_var = RouteParameters_clone(&route_params_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var); - route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned); - LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops; - int64_tArray first_hops_arr = NULL; - if (first_hops != NULL) { - LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr; - first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen); - int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL); - for (size_t q = 0; q < first_hops_var.datalen; q++) { - LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q]; - int64_t first_hops_conv_16_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); - first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned); - first_hops_arr_ptr[q] = first_hops_conv_16_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0); - } - LDKInFlightHtlcs inflight_htlcs_var = inflight_htlcs; - int64_t inflight_htlcs_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var); - inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_meth, payer_arr, route_params_ref, first_hops_arr, inflight_htlcs_ref); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to find_route in LDKRouter from rust threw an exception."); - } - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(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_RouteLightningErrorZ find_route_with_id_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, LDKCVec_ChannelDetailsZ * first_hops, LDKInFlightHtlcs inflight_htlcs, LDKThirtyTwoBytes _payment_hash, LDKThirtyTwoBytes _payment_id) { - 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); - 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 payer_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, payer_arr, 0, 33, payer.compressed_form); - LDKRouteParameters route_params_var = *route_params; - int64_t route_params_ref = 0; - route_params_var = RouteParameters_clone(&route_params_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var); - route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned); - LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops; - int64_tArray first_hops_arr = NULL; - if (first_hops != NULL) { - LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr; - first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen); - int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL); - for (size_t q = 0; q < first_hops_var.datalen; q++) { - LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q]; - int64_t first_hops_conv_16_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); - first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned); - first_hops_arr_ptr[q] = first_hops_conv_16_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0); - } - LDKInFlightHtlcs inflight_htlcs_var = inflight_htlcs; - int64_t inflight_htlcs_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var); - inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned); - int8_tArray _payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, _payment_hash_arr, 0, 32, _payment_hash.data); - int8_tArray _payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, _payment_id_arr, 0, 32, _payment_id.data); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_with_id_meth, payer_arr, route_params_ref, first_hops_arr, inflight_htlcs_ref, _payment_hash_arr, _payment_id_arr); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to find_route_with_id in LDKRouter from rust threw an exception."); - } - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(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_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); - 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); - LDKCVec_ChannelDetailsZ first_hops_var = first_hops; - int64_tArray first_hops_arr = NULL; - first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen); - int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL); - for (size_t q = 0; q < first_hops_var.datalen; q++) { - LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q]; - int64_t first_hops_conv_16_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); - first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned); - first_hops_arr_ptr[q] = first_hops_conv_16_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0); - FREE(first_hops_var.data); - LDKReceiveTlvs tlvs_var = tlvs; - int64_t tlvs_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_var); - tlvs_ref = tag_ptr(tlvs_var.inner, tlvs_var.is_owned); - int64_t amount_msats_conv = amount_msats; - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->create_blinded_payment_paths_meth, recipient_arr, first_hops_arr, tlvs_ref, amount_msats_conv); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to create_blinded_payment_paths in LDKRouter from rust threw an exception."); - } - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(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); - } - return ret_conv; -} -static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) { - LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); - atomic_fetch_add_explicit(&j_calls->MessageRouter->refcnt, 1, memory_order_release); -} -static inline LDKRouter LDKRouter_init (JNIEnv *env, jclass clz, jobject o, jobject MessageRouter) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->find_route_meth = (*env)->GetMethodID(env, c, "find_route", "([BJ[JJ)J"); - CHECK(calls->find_route_meth != NULL); - calls->find_route_with_id_meth = (*env)->GetMethodID(env, c, "find_route_with_id", "([BJ[JJ[B[B)J"); - CHECK(calls->find_route_with_id_meth != NULL); - calls->create_blinded_payment_paths_meth = (*env)->GetMethodID(env, c, "create_blinded_payment_paths", "([B[JJJ)J"); - CHECK(calls->create_blinded_payment_paths_meth != NULL); - - LDKRouter ret = { - .this_arg = (void*) calls, - .find_route = find_route_LDKRouter_jcall, - .find_route_with_id = find_route_with_id_LDKRouter_jcall, - .create_blinded_payment_paths = create_blinded_payment_paths_LDKRouter_jcall, - .free = LDKRouter_JCalls_free, - .MessageRouter = LDKMessageRouter_init(env, clz, MessageRouter), - }; - calls->MessageRouter = ret.MessageRouter.this_arg; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRouter_1new(JNIEnv *env, jclass clz, jobject o, jobject MessageRouter) { - LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter"); - *res_ptr = LDKRouter_init(env, clz, o, MessageRouter); - return tag_ptr(res_ptr, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRouter_1get_1MessageRouter(JNIEnv *env, jclass clz, int64_t arg) { - LDKRouter *inp = (LDKRouter *)untag_ptr(arg); - return tag_ptr(&inp->MessageRouter, false); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t route_params, int64_tArray first_hops, int64_t inflight_htlcs) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr; - LDKPublicKey payer_ref; - CHECK((*env)->GetArrayLength(env, payer) == 33); - (*env)->GetByteArrayRegion(env, payer, 0, 33, payer_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; - 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; - } - 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 = InFlightHtlcs_clone(&inflight_htlcs_conv); - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, &route_params_conv, first_hops_ptr, inflight_htlcs_conv); - if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route_1with_1id(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t route_params, int64_tArray first_hops, int64_t inflight_htlcs, int8_tArray _payment_hash, int8_tArray _payment_id) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr; - LDKPublicKey payer_ref; - CHECK((*env)->GetArrayLength(env, payer) == 33); - (*env)->GetByteArrayRegion(env, payer, 0, 33, payer_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; - 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; - } - 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 = InFlightHtlcs_clone(&inflight_htlcs_conv); - LDKThirtyTwoBytes _payment_hash_ref; - CHECK((*env)->GetArrayLength(env, _payment_hash) == 32); - (*env)->GetByteArrayRegion(env, _payment_hash, 0, 32, _payment_hash_ref.data); - LDKThirtyTwoBytes _payment_id_ref; - CHECK((*env)->GetArrayLength(env, _payment_id) == 32); - (*env)->GetByteArrayRegion(env, _payment_id, 0, 32, _payment_id_ref.data); - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = (this_arg_conv->find_route_with_id)(this_arg_conv->this_arg, payer_ref, &route_params_conv, first_hops_ptr, inflight_htlcs_conv, _payment_hash_ref, _payment_id_ref); - if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1create_1blinded_1payment_1paths(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray recipient, int64_tArray first_hops, int64_t tlvs, int64_t amount_msats) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr; - LDKPublicKey recipient_ref; - CHECK((*env)->GetArrayLength(env, recipient) == 33); - (*env)->GetByteArrayRegion(env, recipient, 0, 33, recipient_ref.compressed_form); - LDKCVec_ChannelDetailsZ first_hops_constr; - 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 = ChannelDetails_clone(&first_hops_conv_16_conv); - first_hops_constr.data[q] = first_hops_conv_16_conv; - } - (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0); - LDKReceiveTlvs tlvs_conv; - tlvs_conv.inner = untag_ptr(tlvs); - tlvs_conv.is_owned = ptr_is_owned(tlvs); - CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_conv); - tlvs_conv = ReceiveTlvs_clone(&tlvs_conv); - 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); -} - static inline struct LDKThirtyTwoBytes C2Tuple_ThirtyTwoBytesChannelManagerZ_get_a(LDKC2Tuple_ThirtyTwoBytesChannelManagerZ *NONNULL_PTR owner){ return ThirtyTwoBytes_clone(&owner->a); } @@ -11649,6 +11941,24 @@ static inline LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ CVec_C2Tup } return ret; } +static inline bool C2Tuple_boolboolZ_get_a(LDKC2Tuple_boolboolZ *NONNULL_PTR owner){ + return owner->a; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_C2Tuple_1boolboolZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_boolboolZ* owner_conv = (LDKC2Tuple_boolboolZ*)untag_ptr(owner); + jboolean ret_conv = C2Tuple_boolboolZ_get_a(owner_conv); + return ret_conv; +} + +static inline bool C2Tuple_boolboolZ_get_b(LDKC2Tuple_boolboolZ *NONNULL_PTR owner){ + return owner->b; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_C2Tuple_1boolboolZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_boolboolZ* owner_conv = (LDKC2Tuple_boolboolZ*)untag_ptr(owner); + jboolean ret_conv = C2Tuple_boolboolZ_get_b(owner_conv); + return ret_conv; +} + static jclass LDKBalance_ClaimableOnChannelClose_class = NULL; static jmethodID LDKBalance_ClaimableOnChannelClose_meth = NULL; static jclass LDKBalance_ClaimableAwaitingConfirmations_class = NULL; @@ -12571,6 +12881,73 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1StrZIOErrorZ_ return ret_conv; } +static inline struct LDKStr C3Tuple_StrStrStrZ_get_a(LDKC3Tuple_StrStrStrZ *NONNULL_PTR owner){ + return owner->a; +} +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_StrStrStrZ* owner_conv = (LDKC3Tuple_StrStrStrZ*)untag_ptr(owner); + LDKStr ret_str = C3Tuple_StrStrStrZ_get_a(owner_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + return ret_conv; +} + +static inline struct LDKStr C3Tuple_StrStrStrZ_get_b(LDKC3Tuple_StrStrStrZ *NONNULL_PTR owner){ + return owner->b; +} +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_StrStrStrZ* owner_conv = (LDKC3Tuple_StrStrStrZ*)untag_ptr(owner); + LDKStr ret_str = C3Tuple_StrStrStrZ_get_b(owner_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + return ret_conv; +} + +static inline struct LDKStr C3Tuple_StrStrStrZ_get_c(LDKC3Tuple_StrStrStrZ *NONNULL_PTR owner){ + return owner->c; +} +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_StrStrStrZ* owner_conv = (LDKC3Tuple_StrStrStrZ*)untag_ptr(owner); + LDKStr ret_str = C3Tuple_StrStrStrZ_get_c(owner_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + return ret_conv; +} + +static inline LDKCVec_C3Tuple_StrStrStrZZ CVec_C3Tuple_StrStrStrZZ_clone(const LDKCVec_C3Tuple_StrStrStrZZ *orig) { + LDKCVec_C3Tuple_StrStrStrZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_StrStrStrZ) * orig->datalen, "LDKCVec_C3Tuple_StrStrStrZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C3Tuple_StrStrStrZ_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKCVec_C3Tuple_StrStrStrZZ CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_get_ok(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return CVec_C3Tuple_StrStrStrZZ_clone(&*owner->contents.result); +} +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* owner_conv = (LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ*)untag_ptr(owner); + LDKCVec_C3Tuple_StrStrStrZZ ret_var = CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_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 x = 0; x < ret_var.datalen; x++) { + LDKC3Tuple_StrStrStrZ* ret_conv_23_conv = MALLOC(sizeof(LDKC3Tuple_StrStrStrZ), "LDKC3Tuple_StrStrStrZ"); + *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; +} + +static inline enum LDKIOError CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_get_err(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* owner_conv = (LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKIOError_to_java(env, CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_get_err(owner_conv)); + return ret_conv; +} + static inline LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ_clone(const LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ *orig) { LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ) * orig->datalen, "LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -12629,27 +13006,51 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoB return ret_conv; } -static inline struct LDKUnsignedInvoiceRequest CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner){ - LDKUnsignedInvoiceRequest ret = *owner->contents.result; +static inline struct LDKMonitorName CResult_MonitorNameIOErrorZ_get_ok(LDKCResult_MonitorNameIOErrorZ *NONNULL_PTR owner){ + LDKMonitorName ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); - LDKUnsignedInvoiceRequest ret_var = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1MonitorNameIOErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_MonitorNameIOErrorZ* owner_conv = (LDKCResult_MonitorNameIOErrorZ*)untag_ptr(owner); + LDKMonitorName ret_var = CResult_MonitorNameIOErrorZ_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 enum LDKBolt12SemanticError CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner){ +static inline enum LDKIOError CResult_MonitorNameIOErrorZ_get_err(LDKCResult_MonitorNameIOErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return Bolt12SemanticError_clone(&*owner->contents.err); + return *owner->contents.err; +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1MonitorNameIOErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_MonitorNameIOErrorZ* owner_conv = (LDKCResult_MonitorNameIOErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKIOError_to_java(env, CResult_MonitorNameIOErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKUpdateName CResult_UpdateNameIOErrorZ_get_ok(LDKCResult_UpdateNameIOErrorZ *NONNULL_PTR owner){ + LDKUpdateName ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateNameIOErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_UpdateNameIOErrorZ* owner_conv = (LDKCResult_UpdateNameIOErrorZ*)untag_ptr(owner); + LDKUpdateName ret_var = CResult_UpdateNameIOErrorZ_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 enum LDKIOError CResult_UpdateNameIOErrorZ_get_err(LDKCResult_UpdateNameIOErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKBolt12SemanticError_to_java(env, CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err(owner_conv)); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateNameIOErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_UpdateNameIOErrorZ* owner_conv = (LDKCResult_UpdateNameIOErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKIOError_to_java(env, CResult_UpdateNameIOErrorZ_get_err(owner_conv)); return ret_conv; } @@ -12748,6 +13149,32 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceWithDerivedS return ret_conv; } +static inline struct LDKInvoiceRequest CResult_InvoiceRequestDecodeErrorZ_get_ok(LDKCResult_InvoiceRequestDecodeErrorZ *NONNULL_PTR owner){ + LDKInvoiceRequest ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceRequestDecodeErrorZ* owner_conv = (LDKCResult_InvoiceRequestDecodeErrorZ*)untag_ptr(owner); + LDKInvoiceRequest ret_var = CResult_InvoiceRequestDecodeErrorZ_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_InvoiceRequestDecodeErrorZ_get_err(LDKCResult_InvoiceRequestDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceRequestDecodeErrorZ* owner_conv = (LDKCResult_InvoiceRequestDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_InvoiceRequestDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKInvoiceRequestFields CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok(LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR owner){ LDKInvoiceRequestFields ret = *owner->contents.result; ret.is_owned = false; @@ -15610,6 +16037,35 @@ static inline LDKCVec_ClaimedHTLCZ CVec_ClaimedHTLCZ_clone(const LDKCVec_Claimed } return ret; } +static jclass LDKInboundChannelFunds_PushMsat_class = NULL; +static jmethodID LDKInboundChannelFunds_PushMsat_meth = NULL; +static jclass LDKInboundChannelFunds_DualFunded_class = NULL; +static jmethodID LDKInboundChannelFunds_DualFunded_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKInboundChannelFunds_init (JNIEnv *env, jclass clz) { + LDKInboundChannelFunds_PushMsat_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKInboundChannelFunds$PushMsat")); + CHECK(LDKInboundChannelFunds_PushMsat_class != NULL); + LDKInboundChannelFunds_PushMsat_meth = (*env)->GetMethodID(env, LDKInboundChannelFunds_PushMsat_class, "", "(J)V"); + CHECK(LDKInboundChannelFunds_PushMsat_meth != NULL); + LDKInboundChannelFunds_DualFunded_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKInboundChannelFunds$DualFunded")); + CHECK(LDKInboundChannelFunds_DualFunded_class != NULL); + LDKInboundChannelFunds_DualFunded_meth = (*env)->GetMethodID(env, LDKInboundChannelFunds_DualFunded_class, "", "()V"); + CHECK(LDKInboundChannelFunds_DualFunded_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKInboundChannelFunds_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKInboundChannelFunds *obj = (LDKInboundChannelFunds*)untag_ptr(ptr); + switch(obj->tag) { + case LDKInboundChannelFunds_PushMsat: { + int64_t push_msat_conv = obj->push_msat; + return (*env)->NewObject(env, LDKInboundChannelFunds_PushMsat_class, LDKInboundChannelFunds_PushMsat_meth, push_msat_conv); + } + case LDKInboundChannelFunds_DualFunded: { + return (*env)->NewObject(env, LDKInboundChannelFunds_DualFunded_class, LDKInboundChannelFunds_DualFunded_meth); + } + default: abort(); + } +} static jclass LDKBumpTransactionEvent_ChannelClose_class = NULL; static jmethodID LDKBumpTransactionEvent_ChannelClose_meth = NULL; static jclass LDKBumpTransactionEvent_HTLCResolution_class = NULL; @@ -15753,12 +16209,12 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en LDKEvent_PaymentClaimable_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentClaimable")); CHECK(LDKEvent_PaymentClaimable_class != NULL); - LDKEvent_PaymentClaimable_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimable_class, "", "([B[BJJJJJJJ)V"); + LDKEvent_PaymentClaimable_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimable_class, "", "([B[BJJJJJJJJ)V"); CHECK(LDKEvent_PaymentClaimable_meth != NULL); 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[JJJ)V"); + LDKEvent_PaymentClaimed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimed_class, "", "([B[BJJ[JJJJ)V"); CHECK(LDKEvent_PaymentClaimed_meth != NULL); LDKEvent_ConnectionNeeded_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ConnectionNeeded")); @@ -15818,7 +16274,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en LDKEvent_PaymentForwarded_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentForwarded")); CHECK(LDKEvent_PaymentForwarded_class != NULL); - LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "", "(JJJJJJZJ)V"); + LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "", "(JJJJ[B[BJJZJ)V"); CHECK(LDKEvent_PaymentForwarded_meth != NULL); LDKEvent_ChannelPending_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelPending")); @@ -15833,7 +16289,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en LDKEvent_ChannelClosed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelClosed")); CHECK(LDKEvent_ChannelClosed_class != NULL); - LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "", "(J[BJ[BJJ)V"); + LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "", "(J[BJ[BJJJ)V"); CHECK(LDKEvent_ChannelClosed_meth != NULL); LDKEvent_DiscardFunding_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$DiscardFunding")); @@ -15921,7 +16377,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN via_channel_id_ref = tag_ptr(via_channel_id_var.inner, false); int64_t via_user_channel_id_ref = tag_ptr(&obj->payment_claimable.via_user_channel_id, false); int64_t claim_deadline_ref = tag_ptr(&obj->payment_claimable.claim_deadline, false); - return (*env)->NewObject(env, LDKEvent_PaymentClaimable_class, LDKEvent_PaymentClaimable_meth, receiver_node_id_arr, payment_hash_arr, onion_fields_ref, amount_msat_conv, counterparty_skimmed_fee_msat_conv, purpose_ref, via_channel_id_ref, via_user_channel_id_ref, claim_deadline_ref); + int64_t payment_id_ref = tag_ptr(&obj->payment_claimable.payment_id, false); + return (*env)->NewObject(env, LDKEvent_PaymentClaimable_class, LDKEvent_PaymentClaimable_meth, receiver_node_id_arr, payment_hash_arr, onion_fields_ref, amount_msat_conv, counterparty_skimmed_fee_msat_conv, purpose_ref, via_channel_id_ref, via_user_channel_id_ref, claim_deadline_ref, payment_id_ref); } case LDKEvent_PaymentClaimed: { int8_tArray receiver_node_id_arr = (*env)->NewByteArray(env, 33); @@ -15947,7 +16404,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN 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); + int64_t payment_id_ref = tag_ptr(&obj->payment_claimed.payment_id, 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, payment_id_ref); } case LDKEvent_ConnectionNeeded: { int8_tArray node_id_arr = (*env)->NewByteArray(env, 33); @@ -16080,11 +16538,15 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN next_channel_id_ref = tag_ptr(next_channel_id_var.inner, false); int64_t prev_user_channel_id_ref = tag_ptr(&obj->payment_forwarded.prev_user_channel_id, false); int64_t next_user_channel_id_ref = tag_ptr(&obj->payment_forwarded.next_user_channel_id, false); + int8_tArray prev_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, prev_node_id_arr, 0, 33, obj->payment_forwarded.prev_node_id.compressed_form); + int8_tArray next_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, next_node_id_arr, 0, 33, obj->payment_forwarded.next_node_id.compressed_form); int64_t total_fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.total_fee_earned_msat, false); int64_t skimmed_fee_msat_ref = tag_ptr(&obj->payment_forwarded.skimmed_fee_msat, false); jboolean claim_from_onchain_tx_conv = obj->payment_forwarded.claim_from_onchain_tx; int64_t outbound_amount_forwarded_msat_ref = tag_ptr(&obj->payment_forwarded.outbound_amount_forwarded_msat, false); - return (*env)->NewObject(env, LDKEvent_PaymentForwarded_class, LDKEvent_PaymentForwarded_meth, prev_channel_id_ref, next_channel_id_ref, prev_user_channel_id_ref, next_user_channel_id_ref, total_fee_earned_msat_ref, skimmed_fee_msat_ref, claim_from_onchain_tx_conv, outbound_amount_forwarded_msat_ref); + return (*env)->NewObject(env, LDKEvent_PaymentForwarded_class, LDKEvent_PaymentForwarded_meth, prev_channel_id_ref, next_channel_id_ref, prev_user_channel_id_ref, next_user_channel_id_ref, prev_node_id_arr, next_node_id_arr, total_fee_earned_msat_ref, skimmed_fee_msat_ref, claim_from_onchain_tx_conv, outbound_amount_forwarded_msat_ref); } case LDKEvent_ChannelPending: { LDKChannelId channel_id_var = obj->channel_pending.channel_id; @@ -16139,7 +16601,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN int64_t channel_funding_txo_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_txo_var); channel_funding_txo_ref = tag_ptr(channel_funding_txo_var.inner, false); - return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_ref, user_channel_id_arr, reason_ref, counterparty_node_id_arr, channel_capacity_sats_ref, channel_funding_txo_ref); + int64_t last_local_balance_msat_ref = tag_ptr(&obj->channel_closed.last_local_balance_msat, false); + return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_ref, user_channel_id_arr, reason_ref, counterparty_node_id_arr, channel_capacity_sats_ref, channel_funding_txo_ref, last_local_balance_msat_ref); } case LDKEvent_DiscardFunding: { LDKChannelId channel_id_var = obj->discard_funding.channel_id; @@ -16157,7 +16620,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->open_channel_request.counterparty_node_id.compressed_form); int64_t funding_satoshis_conv = obj->open_channel_request.funding_satoshis; - int64_t push_msat_conv = obj->open_channel_request.push_msat; + int64_t channel_negotiation_type_ref = tag_ptr(&obj->open_channel_request.channel_negotiation_type, false); LDKChannelTypeFeatures channel_type_var = obj->open_channel_request.channel_type; int64_t channel_type_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var); @@ -16167,7 +16630,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN 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); + return (*env)->NewObject(env, LDKEvent_OpenChannelRequest_class, LDKEvent_OpenChannelRequest_meth, temporary_channel_id_ref, counterparty_node_id_arr, funding_satoshis_conv, channel_negotiation_type_ref, channel_type_ref, is_announced_conv, params_ref); } case LDKEvent_HTLCHandlingFailed: { LDKChannelId prev_channel_id_var = obj->htlc_handling_failed.prev_channel_id; @@ -16284,200 +16747,6 @@ static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_Route } return ret; } -static jclass LDKBolt11ParseError_Bech32Error_class = NULL; -static jmethodID LDKBolt11ParseError_Bech32Error_meth = NULL; -static jclass LDKBolt11ParseError_ParseAmountError_class = NULL; -static jmethodID LDKBolt11ParseError_ParseAmountError_meth = NULL; -static jclass LDKBolt11ParseError_MalformedSignature_class = NULL; -static jmethodID LDKBolt11ParseError_MalformedSignature_meth = NULL; -static jclass LDKBolt11ParseError_BadPrefix_class = NULL; -static jmethodID LDKBolt11ParseError_BadPrefix_meth = NULL; -static jclass LDKBolt11ParseError_UnknownCurrency_class = NULL; -static jmethodID LDKBolt11ParseError_UnknownCurrency_meth = NULL; -static jclass LDKBolt11ParseError_UnknownSiPrefix_class = NULL; -static jmethodID LDKBolt11ParseError_UnknownSiPrefix_meth = NULL; -static jclass LDKBolt11ParseError_MalformedHRP_class = NULL; -static jmethodID LDKBolt11ParseError_MalformedHRP_meth = NULL; -static jclass LDKBolt11ParseError_TooShortDataPart_class = NULL; -static jmethodID LDKBolt11ParseError_TooShortDataPart_meth = NULL; -static jclass LDKBolt11ParseError_UnexpectedEndOfTaggedFields_class = NULL; -static jmethodID LDKBolt11ParseError_UnexpectedEndOfTaggedFields_meth = NULL; -static jclass LDKBolt11ParseError_DescriptionDecodeError_class = NULL; -static jmethodID LDKBolt11ParseError_DescriptionDecodeError_meth = NULL; -static jclass LDKBolt11ParseError_PaddingError_class = NULL; -static jmethodID LDKBolt11ParseError_PaddingError_meth = NULL; -static jclass LDKBolt11ParseError_IntegerOverflowError_class = NULL; -static jmethodID LDKBolt11ParseError_IntegerOverflowError_meth = NULL; -static jclass LDKBolt11ParseError_InvalidSegWitProgramLength_class = NULL; -static jmethodID LDKBolt11ParseError_InvalidSegWitProgramLength_meth = NULL; -static jclass LDKBolt11ParseError_InvalidPubKeyHashLength_class = NULL; -static jmethodID LDKBolt11ParseError_InvalidPubKeyHashLength_meth = NULL; -static jclass LDKBolt11ParseError_InvalidScriptHashLength_class = NULL; -static jmethodID LDKBolt11ParseError_InvalidScriptHashLength_meth = NULL; -static jclass LDKBolt11ParseError_InvalidRecoveryId_class = NULL; -static jmethodID LDKBolt11ParseError_InvalidRecoveryId_meth = NULL; -static jclass LDKBolt11ParseError_InvalidSliceLength_class = NULL; -static jmethodID LDKBolt11ParseError_InvalidSliceLength_meth = NULL; -static jclass LDKBolt11ParseError_Skip_class = NULL; -static jmethodID LDKBolt11ParseError_Skip_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBolt11ParseError_init (JNIEnv *env, jclass clz) { - LDKBolt11ParseError_Bech32Error_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$Bech32Error")); - CHECK(LDKBolt11ParseError_Bech32Error_class != NULL); - LDKBolt11ParseError_Bech32Error_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_Bech32Error_class, "", "(J)V"); - CHECK(LDKBolt11ParseError_Bech32Error_meth != NULL); - LDKBolt11ParseError_ParseAmountError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$ParseAmountError")); - CHECK(LDKBolt11ParseError_ParseAmountError_class != NULL); - LDKBolt11ParseError_ParseAmountError_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_ParseAmountError_class, "", "(I)V"); - CHECK(LDKBolt11ParseError_ParseAmountError_meth != NULL); - LDKBolt11ParseError_MalformedSignature_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$MalformedSignature")); - CHECK(LDKBolt11ParseError_MalformedSignature_class != NULL); - LDKBolt11ParseError_MalformedSignature_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_MalformedSignature_class, "", "(Lorg/ldk/enums/Secp256k1Error;)V"); - CHECK(LDKBolt11ParseError_MalformedSignature_meth != NULL); - LDKBolt11ParseError_BadPrefix_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$BadPrefix")); - CHECK(LDKBolt11ParseError_BadPrefix_class != NULL); - LDKBolt11ParseError_BadPrefix_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_BadPrefix_class, "", "()V"); - CHECK(LDKBolt11ParseError_BadPrefix_meth != NULL); - LDKBolt11ParseError_UnknownCurrency_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$UnknownCurrency")); - CHECK(LDKBolt11ParseError_UnknownCurrency_class != NULL); - LDKBolt11ParseError_UnknownCurrency_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_UnknownCurrency_class, "", "()V"); - CHECK(LDKBolt11ParseError_UnknownCurrency_meth != NULL); - LDKBolt11ParseError_UnknownSiPrefix_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$UnknownSiPrefix")); - CHECK(LDKBolt11ParseError_UnknownSiPrefix_class != NULL); - LDKBolt11ParseError_UnknownSiPrefix_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_UnknownSiPrefix_class, "", "()V"); - CHECK(LDKBolt11ParseError_UnknownSiPrefix_meth != NULL); - LDKBolt11ParseError_MalformedHRP_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$MalformedHRP")); - CHECK(LDKBolt11ParseError_MalformedHRP_class != NULL); - LDKBolt11ParseError_MalformedHRP_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_MalformedHRP_class, "", "()V"); - CHECK(LDKBolt11ParseError_MalformedHRP_meth != NULL); - LDKBolt11ParseError_TooShortDataPart_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$TooShortDataPart")); - CHECK(LDKBolt11ParseError_TooShortDataPart_class != NULL); - LDKBolt11ParseError_TooShortDataPart_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_TooShortDataPart_class, "", "()V"); - CHECK(LDKBolt11ParseError_TooShortDataPart_meth != NULL); - LDKBolt11ParseError_UnexpectedEndOfTaggedFields_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$UnexpectedEndOfTaggedFields")); - CHECK(LDKBolt11ParseError_UnexpectedEndOfTaggedFields_class != NULL); - LDKBolt11ParseError_UnexpectedEndOfTaggedFields_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_UnexpectedEndOfTaggedFields_class, "", "()V"); - CHECK(LDKBolt11ParseError_UnexpectedEndOfTaggedFields_meth != NULL); - LDKBolt11ParseError_DescriptionDecodeError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$DescriptionDecodeError")); - CHECK(LDKBolt11ParseError_DescriptionDecodeError_class != NULL); - LDKBolt11ParseError_DescriptionDecodeError_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_DescriptionDecodeError_class, "", "(I)V"); - CHECK(LDKBolt11ParseError_DescriptionDecodeError_meth != NULL); - LDKBolt11ParseError_PaddingError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$PaddingError")); - CHECK(LDKBolt11ParseError_PaddingError_class != NULL); - LDKBolt11ParseError_PaddingError_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_PaddingError_class, "", "()V"); - CHECK(LDKBolt11ParseError_PaddingError_meth != NULL); - LDKBolt11ParseError_IntegerOverflowError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$IntegerOverflowError")); - CHECK(LDKBolt11ParseError_IntegerOverflowError_class != NULL); - LDKBolt11ParseError_IntegerOverflowError_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_IntegerOverflowError_class, "", "()V"); - CHECK(LDKBolt11ParseError_IntegerOverflowError_meth != NULL); - LDKBolt11ParseError_InvalidSegWitProgramLength_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$InvalidSegWitProgramLength")); - CHECK(LDKBolt11ParseError_InvalidSegWitProgramLength_class != NULL); - LDKBolt11ParseError_InvalidSegWitProgramLength_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_InvalidSegWitProgramLength_class, "", "()V"); - CHECK(LDKBolt11ParseError_InvalidSegWitProgramLength_meth != NULL); - LDKBolt11ParseError_InvalidPubKeyHashLength_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$InvalidPubKeyHashLength")); - CHECK(LDKBolt11ParseError_InvalidPubKeyHashLength_class != NULL); - LDKBolt11ParseError_InvalidPubKeyHashLength_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_InvalidPubKeyHashLength_class, "", "()V"); - CHECK(LDKBolt11ParseError_InvalidPubKeyHashLength_meth != NULL); - LDKBolt11ParseError_InvalidScriptHashLength_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$InvalidScriptHashLength")); - CHECK(LDKBolt11ParseError_InvalidScriptHashLength_class != NULL); - LDKBolt11ParseError_InvalidScriptHashLength_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_InvalidScriptHashLength_class, "", "()V"); - CHECK(LDKBolt11ParseError_InvalidScriptHashLength_meth != NULL); - LDKBolt11ParseError_InvalidRecoveryId_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$InvalidRecoveryId")); - CHECK(LDKBolt11ParseError_InvalidRecoveryId_class != NULL); - LDKBolt11ParseError_InvalidRecoveryId_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_InvalidRecoveryId_class, "", "()V"); - CHECK(LDKBolt11ParseError_InvalidRecoveryId_meth != NULL); - LDKBolt11ParseError_InvalidSliceLength_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$InvalidSliceLength")); - CHECK(LDKBolt11ParseError_InvalidSliceLength_class != NULL); - LDKBolt11ParseError_InvalidSliceLength_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_InvalidSliceLength_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKBolt11ParseError_InvalidSliceLength_meth != NULL); - LDKBolt11ParseError_Skip_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11ParseError$Skip")); - CHECK(LDKBolt11ParseError_Skip_class != NULL); - LDKBolt11ParseError_Skip_meth = (*env)->GetMethodID(env, LDKBolt11ParseError_Skip_class, "", "()V"); - CHECK(LDKBolt11ParseError_Skip_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBolt11ParseError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKBolt11ParseError *obj = (LDKBolt11ParseError*)untag_ptr(ptr); - switch(obj->tag) { - case LDKBolt11ParseError_Bech32Error: { - int64_t bech32_error_ref = tag_ptr(&obj->bech32_error, false); - return (*env)->NewObject(env, LDKBolt11ParseError_Bech32Error_class, LDKBolt11ParseError_Bech32Error_meth, bech32_error_ref); - } - case LDKBolt11ParseError_ParseAmountError: { - /*obj->parse_amount_error*/ - return (*env)->NewObject(env, LDKBolt11ParseError_ParseAmountError_class, LDKBolt11ParseError_ParseAmountError_meth, 0); - } - case LDKBolt11ParseError_MalformedSignature: { - jclass malformed_signature_conv = LDKSecp256k1Error_to_java(env, obj->malformed_signature); - return (*env)->NewObject(env, LDKBolt11ParseError_MalformedSignature_class, LDKBolt11ParseError_MalformedSignature_meth, malformed_signature_conv); - } - case LDKBolt11ParseError_BadPrefix: { - return (*env)->NewObject(env, LDKBolt11ParseError_BadPrefix_class, LDKBolt11ParseError_BadPrefix_meth); - } - case LDKBolt11ParseError_UnknownCurrency: { - return (*env)->NewObject(env, LDKBolt11ParseError_UnknownCurrency_class, LDKBolt11ParseError_UnknownCurrency_meth); - } - case LDKBolt11ParseError_UnknownSiPrefix: { - return (*env)->NewObject(env, LDKBolt11ParseError_UnknownSiPrefix_class, LDKBolt11ParseError_UnknownSiPrefix_meth); - } - case LDKBolt11ParseError_MalformedHRP: { - return (*env)->NewObject(env, LDKBolt11ParseError_MalformedHRP_class, LDKBolt11ParseError_MalformedHRP_meth); - } - case LDKBolt11ParseError_TooShortDataPart: { - return (*env)->NewObject(env, LDKBolt11ParseError_TooShortDataPart_class, LDKBolt11ParseError_TooShortDataPart_meth); - } - case LDKBolt11ParseError_UnexpectedEndOfTaggedFields: { - return (*env)->NewObject(env, LDKBolt11ParseError_UnexpectedEndOfTaggedFields_class, LDKBolt11ParseError_UnexpectedEndOfTaggedFields_meth); - } - case LDKBolt11ParseError_DescriptionDecodeError: { - /*obj->description_decode_error*/ - return (*env)->NewObject(env, LDKBolt11ParseError_DescriptionDecodeError_class, LDKBolt11ParseError_DescriptionDecodeError_meth, 0); - } - case LDKBolt11ParseError_PaddingError: { - return (*env)->NewObject(env, LDKBolt11ParseError_PaddingError_class, LDKBolt11ParseError_PaddingError_meth); - } - case LDKBolt11ParseError_IntegerOverflowError: { - return (*env)->NewObject(env, LDKBolt11ParseError_IntegerOverflowError_class, LDKBolt11ParseError_IntegerOverflowError_meth); - } - case LDKBolt11ParseError_InvalidSegWitProgramLength: { - return (*env)->NewObject(env, LDKBolt11ParseError_InvalidSegWitProgramLength_class, LDKBolt11ParseError_InvalidSegWitProgramLength_meth); - } - case LDKBolt11ParseError_InvalidPubKeyHashLength: { - return (*env)->NewObject(env, LDKBolt11ParseError_InvalidPubKeyHashLength_class, LDKBolt11ParseError_InvalidPubKeyHashLength_meth); - } - case LDKBolt11ParseError_InvalidScriptHashLength: { - return (*env)->NewObject(env, LDKBolt11ParseError_InvalidScriptHashLength_class, LDKBolt11ParseError_InvalidScriptHashLength_meth); - } - case LDKBolt11ParseError_InvalidRecoveryId: { - return (*env)->NewObject(env, LDKBolt11ParseError_InvalidRecoveryId_class, LDKBolt11ParseError_InvalidRecoveryId_meth); - } - case LDKBolt11ParseError_InvalidSliceLength: { - LDKStr invalid_slice_length_str = obj->invalid_slice_length; - jstring invalid_slice_length_conv = str_ref_to_java(env, invalid_slice_length_str.chars, invalid_slice_length_str.len); - return (*env)->NewObject(env, LDKBolt11ParseError_InvalidSliceLength_class, LDKBolt11ParseError_InvalidSliceLength_meth, invalid_slice_length_conv); - } - case LDKBolt11ParseError_Skip: { - return (*env)->NewObject(env, LDKBolt11ParseError_Skip_class, LDKBolt11ParseError_Skip_meth); - } - default: abort(); - } -} static inline enum LDKSiPrefix CResult_SiPrefixBolt11ParseErrorZ_get_ok(LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return SiPrefix_clone(&*owner->contents.result); @@ -16489,14 +16758,16 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixBolt11Parse } static inline struct LDKBolt11ParseError CResult_SiPrefixBolt11ParseErrorZ_get_err(LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return Bolt11ParseError_clone(&*owner->contents.err); + LDKBolt11ParseError ret = *owner->contents.err; + ret.is_owned = false; + return ret; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixBolt11ParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { LDKCResult_SiPrefixBolt11ParseErrorZ* owner_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(owner); - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = CResult_SiPrefixBolt11ParseErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKBolt11ParseError ret_var = CResult_SiPrefixBolt11ParseErrorZ_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; } @@ -16520,7 +16791,10 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseOrSemanticError_1re LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr); switch(obj->tag) { case LDKParseOrSemanticError_ParseError: { - int64_t parse_error_ref = tag_ptr(&obj->parse_error, false); + LDKBolt11ParseError parse_error_var = obj->parse_error; + int64_t parse_error_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(parse_error_var); + parse_error_ref = tag_ptr(parse_error_var.inner, false); return (*env)->NewObject(env, LDKParseOrSemanticError_ParseError_class, LDKParseOrSemanticError_ParseError_meth, parse_error_ref); } case LDKParseOrSemanticError_SemanticError: { @@ -16571,14 +16845,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawBolt11Inv } static inline struct LDKBolt11ParseError CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_get_err(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return Bolt11ParseError_clone(&*owner->contents.err); + LDKBolt11ParseError ret = *owner->contents.err; + ret.is_owned = false; + return ret; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawBolt11InvoiceBolt11ParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* owner_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(owner); - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKBolt11ParseError ret_var = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_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; } @@ -16945,6 +17221,188 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelIdDecodeErr return ret_ref; } +static inline struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKInitFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKInitFeatures ret_var = CResult_InitFeaturesDecodeErrorZ_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_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKChannelFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKChannelFeatures ret_var = CResult_ChannelFeaturesDecodeErrorZ_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_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKNodeFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKNodeFeatures ret_var = CResult_NodeFeaturesDecodeErrorZ_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_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBolt11InvoiceFeatures CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKBolt11InvoiceFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKBolt11InvoiceFeatures ret_var = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_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_Bolt11InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBolt12InvoiceFeatures CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKBolt12InvoiceFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKBolt12InvoiceFeatures ret_var = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_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_Bolt12InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBlindedHopFeatures CResult_BlindedHopFeaturesDecodeErrorZ_get_ok(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedHopFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedHopFeaturesDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKBlindedHopFeatures ret_var = CResult_BlindedHopFeaturesDecodeErrorZ_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_BlindedHopFeaturesDecodeErrorZ_get_err(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedHopFeaturesDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BlindedHopFeaturesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKChannelTypeFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKChannelTypeFeatures ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_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_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKThirtyTwoBytes C2Tuple__u832u16Z_get_a(LDKC2Tuple__u832u16Z *NONNULL_PTR owner){ return ThirtyTwoBytes_clone(&owner->a); } @@ -17096,32 +17554,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentContextDeco return ret_ref; } -static inline struct LDKUnknownPaymentContext CResult_UnknownPaymentContextDecodeErrorZ_get_ok(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR owner){ - LDKUnknownPaymentContext ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* owner_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(owner); - LDKUnknownPaymentContext ret_var = CResult_UnknownPaymentContextDecodeErrorZ_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_UnknownPaymentContextDecodeErrorZ_get_err(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* owner_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_UnknownPaymentContextDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - static inline struct LDKBolt12OfferContext CResult_Bolt12OfferContextDecodeErrorZ_get_ok(LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR owner){ LDKBolt12OfferContext ret = *owner->contents.result; ret.is_owned = false; @@ -17431,6 +17863,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNextMessageHop_1ref_1fro } static jclass LDKParsedOnionMessageContents_Offers_class = NULL; static jmethodID LDKParsedOnionMessageContents_Offers_meth = NULL; +static jclass LDKParsedOnionMessageContents_DNSResolver_class = NULL; +static jmethodID LDKParsedOnionMessageContents_DNSResolver_meth = NULL; static jclass LDKParsedOnionMessageContents_Custom_class = NULL; static jmethodID LDKParsedOnionMessageContents_Custom_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParsedOnionMessageContents_init (JNIEnv *env, jclass clz) { @@ -17439,6 +17873,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParsedOnionMessageCont CHECK(LDKParsedOnionMessageContents_Offers_class != NULL); LDKParsedOnionMessageContents_Offers_meth = (*env)->GetMethodID(env, LDKParsedOnionMessageContents_Offers_class, "", "(J)V"); CHECK(LDKParsedOnionMessageContents_Offers_meth != NULL); + LDKParsedOnionMessageContents_DNSResolver_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParsedOnionMessageContents$DNSResolver")); + CHECK(LDKParsedOnionMessageContents_DNSResolver_class != NULL); + LDKParsedOnionMessageContents_DNSResolver_meth = (*env)->GetMethodID(env, LDKParsedOnionMessageContents_DNSResolver_class, "", "(J)V"); + CHECK(LDKParsedOnionMessageContents_DNSResolver_meth != NULL); LDKParsedOnionMessageContents_Custom_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParsedOnionMessageContents$Custom")); CHECK(LDKParsedOnionMessageContents_Custom_class != NULL); @@ -17452,6 +17891,10 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParsedOnionMessageConten int64_t offers_ref = tag_ptr(&obj->offers, false); return (*env)->NewObject(env, LDKParsedOnionMessageContents_Offers_class, LDKParsedOnionMessageContents_Offers_meth, offers_ref); } + case LDKParsedOnionMessageContents_DNSResolver: { + int64_t dns_resolver_ref = tag_ptr(&obj->dns_resolver, false); + return (*env)->NewObject(env, LDKParsedOnionMessageContents_DNSResolver_class, LDKParsedOnionMessageContents_DNSResolver_meth, dns_resolver_ref); + } case LDKParsedOnionMessageContents_Custom: { LDKOnionMessageContents* custom_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); *custom_ret = OnionMessageContents_clone(&obj->custom); @@ -17628,61 +18071,6 @@ static inline LDKCVec_PhantomRouteHintsZ CVec_PhantomRouteHintsZ_clone(const LDK } 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 inline struct LDKInvoiceError CResult_InvoiceErrorDecodeErrorZ_get_ok(LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR owner){ LDKInvoiceError ret = *owner->contents.result; ret.is_owned = false; @@ -18896,6 +19284,147 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecod return ret_ref; } +static inline struct LDKAsyncPaymentsContext CResult_AsyncPaymentsContextDecodeErrorZ_get_ok(LDKCResult_AsyncPaymentsContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return AsyncPaymentsContext_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_AsyncPaymentsContextDecodeErrorZ* owner_conv = (LDKCResult_AsyncPaymentsContextDecodeErrorZ*)untag_ptr(owner); + LDKAsyncPaymentsContext *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsContext), "LDKAsyncPaymentsContext"); + *ret_copy = CResult_AsyncPaymentsContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_AsyncPaymentsContextDecodeErrorZ_get_err(LDKCResult_AsyncPaymentsContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_AsyncPaymentsContextDecodeErrorZ* owner_conv = (LDKCResult_AsyncPaymentsContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_AsyncPaymentsContextDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDNSResolverContext CResult_DNSResolverContextDecodeErrorZ_get_ok(LDKCResult_DNSResolverContextDecodeErrorZ *NONNULL_PTR owner){ + LDKDNSResolverContext ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_DNSResolverContextDecodeErrorZ* owner_conv = (LDKCResult_DNSResolverContextDecodeErrorZ*)untag_ptr(owner); + LDKDNSResolverContext ret_var = CResult_DNSResolverContextDecodeErrorZ_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_DNSResolverContextDecodeErrorZ_get_err(LDKCResult_DNSResolverContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_DNSResolverContextDecodeErrorZ* owner_conv = (LDKCResult_DNSResolverContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_DNSResolverContextDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +typedef struct LDKMigratableKVStore_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + LDKKVStore_JCalls* KVStore; + jmethodID list_all_keys_meth; +} LDKMigratableKVStore_JCalls; +static void LDKMigratableKVStore_JCalls_free(void* this_arg) { + LDKMigratableKVStore_JCalls *j_calls = (LDKMigratableKVStore_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); + } +} +LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ list_all_keys_LDKMigratableKVStore_jcall(const void* this_arg) { + LDKMigratableKVStore_JCalls *j_calls = (LDKMigratableKVStore_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); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->list_all_keys_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to list_all_keys in LDKMigratableKVStore from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ ret_conv = *(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ*)(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 LDKMigratableKVStore_JCalls_cloned(LDKMigratableKVStore* new_obj) { + LDKMigratableKVStore_JCalls *j_calls = (LDKMigratableKVStore_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + atomic_fetch_add_explicit(&j_calls->KVStore->refcnt, 1, memory_order_release); +} +static inline LDKMigratableKVStore LDKMigratableKVStore_init (JNIEnv *env, jclass clz, jobject o, jobject KVStore) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKMigratableKVStore_JCalls *calls = MALLOC(sizeof(LDKMigratableKVStore_JCalls), "LDKMigratableKVStore_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->list_all_keys_meth = (*env)->GetMethodID(env, c, "list_all_keys", "()J"); + CHECK(calls->list_all_keys_meth != NULL); + + LDKMigratableKVStore ret = { + .this_arg = (void*) calls, + .list_all_keys = list_all_keys_LDKMigratableKVStore_jcall, + .free = LDKMigratableKVStore_JCalls_free, + .KVStore = LDKKVStore_init(env, clz, KVStore), + }; + calls->KVStore = ret.KVStore.this_arg; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKMigratableKVStore_1new(JNIEnv *env, jclass clz, jobject o, jobject KVStore) { + LDKMigratableKVStore *res_ptr = MALLOC(sizeof(LDKMigratableKVStore), "LDKMigratableKVStore"); + *res_ptr = LDKMigratableKVStore_init(env, clz, o, KVStore); + return tag_ptr(res_ptr, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKMigratableKVStore_1get_1KVStore(JNIEnv *env, jclass clz, int64_t arg) { + LDKMigratableKVStore *inp = (LDKMigratableKVStore *)untag_ptr(arg); + return tag_ptr(&inp->KVStore, false); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MigratableKVStore_1list_1all_1keys(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); } + LDKMigratableKVStore* this_arg_conv = (LDKMigratableKVStore*)this_arg_ptr; + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ), "LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ"); + *ret_conv = (this_arg_conv->list_all_keys)(this_arg_conv->this_arg); + return tag_ptr(ret_conv, true); +} + typedef struct LDKPersister_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -19992,6 +20521,169 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1process_1pendi (this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_conv); } +typedef struct LDKVerification_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID hmac_for_offer_payment_meth; + jmethodID verify_for_offer_payment_meth; +} LDKVerification_JCalls; +static void LDKVerification_JCalls_free(void* this_arg) { + LDKVerification_JCalls *j_calls = (LDKVerification_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); + } +} +LDKThirtyTwoBytes hmac_for_offer_payment_LDKVerification_jcall(const void* this_arg, LDKNonce nonce, const LDKExpandedKey * expanded_key) { + LDKVerification_JCalls *j_calls = (LDKVerification_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); + } + LDKNonce nonce_var = nonce; + int64_t nonce_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_var); + nonce_ref = tag_ptr(nonce_var.inner, nonce_var.is_owned); + LDKExpandedKey expanded_key_var = *expanded_key; + int64_t expanded_key_ref = 0; + expanded_key_var = ExpandedKey_clone(&expanded_key_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_var); + expanded_key_ref = tag_ptr(expanded_key_var.inner, expanded_key_var.is_owned); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->hmac_for_offer_payment_meth, nonce_ref, expanded_key_ref); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to hmac_for_offer_payment in LDKVerification from rust threw an exception."); + } + LDKThirtyTwoBytes ret_ref; + CHECK((*env)->GetArrayLength(env, ret) == 32); + (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_ref; +} +LDKCResult_NoneNoneZ verify_for_offer_payment_LDKVerification_jcall(const void* this_arg, LDKThirtyTwoBytes hmac, LDKNonce nonce, const LDKExpandedKey * expanded_key) { + LDKVerification_JCalls *j_calls = (LDKVerification_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 hmac_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, hmac_arr, 0, 32, hmac.data); + LDKNonce nonce_var = nonce; + int64_t nonce_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(nonce_var); + nonce_ref = tag_ptr(nonce_var.inner, nonce_var.is_owned); + LDKExpandedKey expanded_key_var = *expanded_key; + int64_t expanded_key_ref = 0; + expanded_key_var = ExpandedKey_clone(&expanded_key_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_var); + expanded_key_ref = tag_ptr(expanded_key_var.inner, expanded_key_var.is_owned); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->verify_for_offer_payment_meth, hmac_arr, nonce_ref, expanded_key_ref); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to verify_for_offer_payment in LDKVerification 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; +} +static void LDKVerification_JCalls_cloned(LDKVerification* new_obj) { + LDKVerification_JCalls *j_calls = (LDKVerification_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKVerification LDKVerification_init (JNIEnv *env, jclass clz, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKVerification_JCalls *calls = MALLOC(sizeof(LDKVerification_JCalls), "LDKVerification_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->hmac_for_offer_payment_meth = (*env)->GetMethodID(env, c, "hmac_for_offer_payment", "(JJ)[B"); + CHECK(calls->hmac_for_offer_payment_meth != NULL); + calls->verify_for_offer_payment_meth = (*env)->GetMethodID(env, c, "verify_for_offer_payment", "([BJJ)J"); + CHECK(calls->verify_for_offer_payment_meth != NULL); + + LDKVerification ret = { + .this_arg = (void*) calls, + .hmac_for_offer_payment = hmac_for_offer_payment_LDKVerification_jcall, + .verify_for_offer_payment = verify_for_offer_payment_LDKVerification_jcall, + .free = LDKVerification_JCalls_free, + }; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKVerification_1new(JNIEnv *env, jclass clz, jobject o) { + LDKVerification *res_ptr = MALLOC(sizeof(LDKVerification), "LDKVerification"); + *res_ptr = LDKVerification_init(env, clz, o); + return tag_ptr(res_ptr, true); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Verification_1hmac_1for_1offer_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t nonce, int64_t expanded_key) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKVerification* this_arg_conv = (LDKVerification*)this_arg_ptr; + 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 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; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->hmac_for_offer_payment)(this_arg_conv->this_arg, nonce_conv, &expanded_key_conv).data); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Verification_1verify_1for_1offer_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray hmac, int64_t nonce, int64_t expanded_key) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKVerification* this_arg_conv = (LDKVerification*)this_arg_ptr; + LDKThirtyTwoBytes hmac_ref; + CHECK((*env)->GetArrayLength(env, hmac) == 32); + (*env)->GetByteArrayRegion(env, hmac, 0, 32, hmac_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 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; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = (this_arg_conv->verify_for_offer_payment)(this_arg_conv->this_arg, hmac_ref, nonce_conv, &expanded_key_conv); + return tag_ptr(ret_conv, true); +} + static jclass LDKFailureCode_TemporaryNodeFailure_class = NULL; static jmethodID LDKFailureCode_TemporaryNodeFailure_meth = NULL; static jclass LDKFailureCode_RequiredNodeFeatureMissing_class = NULL; @@ -20041,6 +20733,42 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFailureCode_1ref_1from_1 default: abort(); } } +static jclass LDKBolt11InvoiceDescription_Direct_class = NULL; +static jmethodID LDKBolt11InvoiceDescription_Direct_meth = NULL; +static jclass LDKBolt11InvoiceDescription_Hash_class = NULL; +static jmethodID LDKBolt11InvoiceDescription_Hash_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBolt11InvoiceDescription_init (JNIEnv *env, jclass clz) { + LDKBolt11InvoiceDescription_Direct_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11InvoiceDescription$Direct")); + CHECK(LDKBolt11InvoiceDescription_Direct_class != NULL); + LDKBolt11InvoiceDescription_Direct_meth = (*env)->GetMethodID(env, LDKBolt11InvoiceDescription_Direct_class, "", "(J)V"); + CHECK(LDKBolt11InvoiceDescription_Direct_meth != NULL); + LDKBolt11InvoiceDescription_Hash_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBolt11InvoiceDescription$Hash")); + CHECK(LDKBolt11InvoiceDescription_Hash_class != NULL); + LDKBolt11InvoiceDescription_Hash_meth = (*env)->GetMethodID(env, LDKBolt11InvoiceDescription_Hash_class, "", "(J)V"); + CHECK(LDKBolt11InvoiceDescription_Hash_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBolt11InvoiceDescription_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKBolt11InvoiceDescription *obj = (LDKBolt11InvoiceDescription*)untag_ptr(ptr); + switch(obj->tag) { + case LDKBolt11InvoiceDescription_Direct: { + LDKDescription direct_var = obj->direct; + int64_t direct_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(direct_var); + direct_ref = tag_ptr(direct_var.inner, false); + return (*env)->NewObject(env, LDKBolt11InvoiceDescription_Direct_class, LDKBolt11InvoiceDescription_Direct_meth, direct_ref); + } + case LDKBolt11InvoiceDescription_Hash: { + LDKSha256 hash_var = obj->hash; + int64_t hash_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(hash_var); + hash_ref = tag_ptr(hash_var.inner, false); + return (*env)->NewObject(env, LDKBolt11InvoiceDescription_Hash_class, LDKBolt11InvoiceDescription_Hash_meth, hash_ref); + } + default: abort(); + } +} typedef struct LDKMessageSendEventsProvider_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -20186,6 +20914,7 @@ typedef struct LDKChannelMessageHandler_JCalls { jmethodID provided_node_features_meth; jmethodID provided_init_features_meth; jmethodID get_chain_hashes_meth; + jmethodID message_received_meth; } LDKChannelMessageHandler_JCalls; static void LDKChannelMessageHandler_JCalls_free(void* this_arg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -21146,6 +21875,26 @@ LDKCOption_CVec_ThirtyTwoBytesZZ get_chain_hashes_LDKChannelMessageHandler_jcall } return ret_conv; } +void message_received_LDKChannelMessageHandler_jcall(const void* this_arg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_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); + (*env)->CallVoidMethod(env, obj, j_calls->message_received_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to message_received in LDKChannelMessageHandler from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} static void LDKChannelMessageHandler_JCalls_cloned(LDKChannelMessageHandler* new_obj) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) new_obj->this_arg; atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); @@ -21228,6 +21977,8 @@ static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv *en CHECK(calls->provided_init_features_meth != NULL); calls->get_chain_hashes_meth = (*env)->GetMethodID(env, c, "get_chain_hashes", "()J"); CHECK(calls->get_chain_hashes_meth != NULL); + calls->message_received_meth = (*env)->GetMethodID(env, c, "message_received", "()V"); + CHECK(calls->message_received_meth != NULL); LDKChannelMessageHandler ret = { .this_arg = (void*) calls, @@ -21266,6 +22017,7 @@ static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv *en .provided_node_features = provided_node_features_LDKChannelMessageHandler_jcall, .provided_init_features = provided_init_features_LDKChannelMessageHandler_jcall, .get_chain_hashes = get_chain_hashes_LDKChannelMessageHandler_jcall, + .message_received = message_received_LDKChannelMessageHandler_jcall, .free = LDKChannelMessageHandler_JCalls_free, .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, clz, MessageSendEventsProvider), }; @@ -21793,6 +22545,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1get_ return ret_ref; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1message_1received(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); } + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; + (this_arg_conv->message_received)(this_arg_conv->this_arg); +} + typedef struct LDKOffersMessageHandler_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -21963,8 +22722,8 @@ typedef struct LDKAsyncPaymentsMessageHandler_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; - jmethodID held_htlc_available_meth; - jmethodID release_held_htlc_meth; + jmethodID handle_held_htlc_available_meth; + jmethodID handle_release_held_htlc_meth; jmethodID release_pending_messages_meth; } LDKAsyncPaymentsMessageHandler_JCalls; static void LDKAsyncPaymentsMessageHandler_JCalls_free(void* this_arg) { @@ -21984,7 +22743,7 @@ static void LDKAsyncPaymentsMessageHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ held_htlc_available_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg, LDKHeldHtlcAvailable message, LDKResponder responder) { +LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ handle_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); @@ -22003,10 +22762,10 @@ LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ held_htlc_available_LDKA 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); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_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."); + (*env)->FatalError(env, "A call to handle_held_htlc_available in LDKAsyncPaymentsMessageHandler from rust threw an exception."); } void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); @@ -22017,7 +22776,7 @@ LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ held_htlc_available_LDKA } return ret_conv; } -void release_held_htlc_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg, LDKReleaseHeldHtlc message) { +void handle_release_held_htlc_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg, LDKReleaseHeldHtlc message, LDKAsyncPaymentsContext context) { 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); @@ -22030,12 +22789,15 @@ void release_held_htlc_LDKAsyncPaymentsMessageHandler_jcall(const void* this_arg int64_t message_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(message_var); message_ref = tag_ptr(message_var.inner, message_var.is_owned); + LDKAsyncPaymentsContext *context_copy = MALLOC(sizeof(LDKAsyncPaymentsContext), "LDKAsyncPaymentsContext"); + *context_copy = context; + int64_t context_ref = tag_ptr(context_copy, true); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->release_held_htlc_meth, message_ref); + (*env)->CallVoidMethod(env, obj, j_calls->handle_release_held_htlc_meth, message_ref, context_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."); + (*env)->FatalError(env, "A call to handle_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); @@ -22089,17 +22851,17 @@ static inline LDKAsyncPaymentsMessageHandler LDKAsyncPaymentsMessageHandler_init 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->handle_held_htlc_available_meth = (*env)->GetMethodID(env, c, "handle_held_htlc_available", "(JJ)J"); + CHECK(calls->handle_held_htlc_available_meth != NULL); + calls->handle_release_held_htlc_meth = (*env)->GetMethodID(env, c, "handle_release_held_htlc", "(JJ)V"); + CHECK(calls->handle_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, + .handle_held_htlc_available = handle_held_htlc_available_LDKAsyncPaymentsMessageHandler_jcall, + .handle_release_held_htlc = handle_release_held_htlc_LDKAsyncPaymentsMessageHandler_jcall, .release_pending_messages = release_pending_messages_LDKAsyncPaymentsMessageHandler_jcall, .free = LDKAsyncPaymentsMessageHandler_JCalls_free, }; @@ -22110,7 +22872,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKAsyncPaymentsMessageHand *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) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1handle_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; @@ -22125,12 +22887,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler 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); + *ret_copy = (this_arg_conv->handle_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) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1handle_1release_1held_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message, int64_t context) { 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; @@ -22139,7 +22901,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1r 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); + void* context_ptr = untag_ptr(context); + CHECK_ACCESS(context_ptr); + LDKAsyncPaymentsContext context_conv = *(LDKAsyncPaymentsContext*)(context_ptr); + context_conv = AsyncPaymentsContext_clone((LDKAsyncPaymentsContext*)untag_ptr(context)); + (this_arg_conv->handle_release_held_htlc)(this_arg_conv->this_arg, message_conv, context_conv); } JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1release_1pending_1messages(JNIEnv *env, jclass clz, int64_t this_arg) { @@ -22160,6 +22926,256 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHa return ret_arr; } +typedef struct LDKDNSResolverMessageHandler_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID handle_dnssec_query_meth; + jmethodID handle_dnssec_proof_meth; + jmethodID provided_node_features_meth; + jmethodID release_pending_messages_meth; +} LDKDNSResolverMessageHandler_JCalls; +static void LDKDNSResolverMessageHandler_JCalls_free(void* this_arg) { + LDKDNSResolverMessageHandler_JCalls *j_calls = (LDKDNSResolverMessageHandler_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_DNSResolverMessageResponseInstructionZZ handle_dnssec_query_LDKDNSResolverMessageHandler_jcall(const void* this_arg, LDKDNSSECQuery message, LDKResponder responder) { + LDKDNSResolverMessageHandler_JCalls *j_calls = (LDKDNSResolverMessageHandler_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); + } + LDKDNSSECQuery 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->handle_dnssec_query_meth, message_ref, responder_ref); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to handle_dnssec_query in LDKDNSResolverMessageHandler from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ ret_conv = *(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ*)(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 handle_dnssec_proof_LDKDNSResolverMessageHandler_jcall(const void* this_arg, LDKDNSSECProof message, LDKDNSResolverContext context) { + LDKDNSResolverMessageHandler_JCalls *j_calls = (LDKDNSResolverMessageHandler_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); + } + LDKDNSSECProof 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); + LDKDNSResolverContext context_var = context; + int64_t context_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(context_var); + context_ref = tag_ptr(context_var.inner, context_var.is_owned); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->handle_dnssec_proof_meth, message_ref, context_ref); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to handle_dnssec_proof in LDKDNSResolverMessageHandler from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +LDKNodeFeatures provided_node_features_LDKDNSResolverMessageHandler_jcall(const void* this_arg) { + LDKDNSResolverMessageHandler_JCalls *j_calls = (LDKDNSResolverMessageHandler_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); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_node_features_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to provided_node_features in LDKDNSResolverMessageHandler from rust threw an exception."); + } + LDKNodeFeatures ret_conv; + ret_conv.inner = untag_ptr(ret); + ret_conv.is_owned = ptr_is_owned(ret); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; +} +LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ release_pending_messages_LDKDNSResolverMessageHandler_jcall(const void* this_arg) { + LDKDNSResolverMessageHandler_JCalls *j_calls = (LDKDNSResolverMessageHandler_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 LDKDNSResolverMessageHandler from rust threw an exception."); + } + LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ ret_constr; + ret_constr.datalen = (*env)->GetArrayLength(env, ret); + if (ret_constr.datalen > 0) + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ Elements"); + else + ret_constr.data = NULL; + int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL); + for (size_t b = 0; b < ret_constr.datalen; b++) { + int64_t ret_conv_53 = ret_vals[b]; + void* ret_conv_53_ptr = untag_ptr(ret_conv_53); + CHECK_ACCESS(ret_conv_53_ptr); + LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ ret_conv_53_conv = *(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ*)(ret_conv_53_ptr); + FREE(untag_ptr(ret_conv_53)); + ret_constr.data[b] = ret_conv_53_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 LDKDNSResolverMessageHandler_JCalls_cloned(LDKDNSResolverMessageHandler* new_obj) { + LDKDNSResolverMessageHandler_JCalls *j_calls = (LDKDNSResolverMessageHandler_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKDNSResolverMessageHandler LDKDNSResolverMessageHandler_init (JNIEnv *env, jclass clz, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKDNSResolverMessageHandler_JCalls *calls = MALLOC(sizeof(LDKDNSResolverMessageHandler_JCalls), "LDKDNSResolverMessageHandler_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->handle_dnssec_query_meth = (*env)->GetMethodID(env, c, "handle_dnssec_query", "(JJ)J"); + CHECK(calls->handle_dnssec_query_meth != NULL); + calls->handle_dnssec_proof_meth = (*env)->GetMethodID(env, c, "handle_dnssec_proof", "(JJ)V"); + CHECK(calls->handle_dnssec_proof_meth != NULL); + calls->provided_node_features_meth = (*env)->GetMethodID(env, c, "provided_node_features", "()J"); + CHECK(calls->provided_node_features_meth != NULL); + calls->release_pending_messages_meth = (*env)->GetMethodID(env, c, "release_pending_messages", "()[J"); + CHECK(calls->release_pending_messages_meth != NULL); + + LDKDNSResolverMessageHandler ret = { + .this_arg = (void*) calls, + .handle_dnssec_query = handle_dnssec_query_LDKDNSResolverMessageHandler_jcall, + .handle_dnssec_proof = handle_dnssec_proof_LDKDNSResolverMessageHandler_jcall, + .provided_node_features = provided_node_features_LDKDNSResolverMessageHandler_jcall, + .release_pending_messages = release_pending_messages_LDKDNSResolverMessageHandler_jcall, + .free = LDKDNSResolverMessageHandler_JCalls_free, + }; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKDNSResolverMessageHandler_1new(JNIEnv *env, jclass clz, jobject o) { + LDKDNSResolverMessageHandler *res_ptr = MALLOC(sizeof(LDKDNSResolverMessageHandler), "LDKDNSResolverMessageHandler"); + *res_ptr = LDKDNSResolverMessageHandler_init(env, clz, o); + return tag_ptr(res_ptr, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSResolverMessageHandler_1handle_1dnssec_1query(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); } + LDKDNSResolverMessageHandler* this_arg_conv = (LDKDNSResolverMessageHandler*)this_arg_ptr; + LDKDNSSECQuery 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 = DNSSECQuery_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_DNSResolverMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ), "LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ"); + *ret_copy = (this_arg_conv->handle_dnssec_query)(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_DNSResolverMessageHandler_1handle_1dnssec_1proof(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message, int64_t context) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKDNSResolverMessageHandler* this_arg_conv = (LDKDNSResolverMessageHandler*)this_arg_ptr; + LDKDNSSECProof 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 = DNSSECProof_clone(&message_conv); + LDKDNSResolverContext context_conv; + context_conv.inner = untag_ptr(context); + context_conv.is_owned = ptr_is_owned(context); + CHECK_INNER_FIELD_ACCESS_OR_NULL(context_conv); + context_conv = DNSResolverContext_clone(&context_conv); + (this_arg_conv->handle_dnssec_proof)(this_arg_conv->this_arg, message_conv, context_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSResolverMessageHandler_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); } + LDKDNSResolverMessageHandler* this_arg_conv = (LDKDNSResolverMessageHandler*)this_arg_ptr; + LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg); + int64_t ret_ref = 0; + 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_DNSResolverMessageHandler_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); } + LDKDNSResolverMessageHandler* this_arg_conv = (LDKDNSResolverMessageHandler*)this_arg_ptr; + LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ 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 b = 0; b < ret_var.datalen; b++) { + LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ* ret_conv_53_conv = MALLOC(sizeof(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ), "LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ"); + *ret_conv_53_conv = ret_var.data[b]; + ret_arr_ptr[b] = tag_ptr(ret_conv_53_conv, true); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + typedef struct LDKNodeIdLookUp_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -22279,7 +23295,7 @@ static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) { +LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKNodeAnnouncement * msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -22288,6 +23304,8 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler } 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); LDKNodeAnnouncement msg_var = *msg; int64_t msg_ref = 0; msg_var = NodeAnnouncement_clone(&msg_var); @@ -22295,7 +23313,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_node_announcement_meth, msg_ref); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_node_announcement_meth, their_node_id_arr, msg_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to handle_node_announcement in LDKRoutingMessageHandler from rust threw an exception."); @@ -22309,7 +23327,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler } return ret_conv; } -LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) { +LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelAnnouncement * msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -22318,6 +23336,8 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand } 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); LDKChannelAnnouncement msg_var = *msg; int64_t msg_ref = 0; msg_var = ChannelAnnouncement_clone(&msg_var); @@ -22325,7 +23345,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_announcement_meth, msg_ref); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_announcement_meth, their_node_id_arr, msg_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to handle_channel_announcement in LDKRoutingMessageHandler from rust threw an exception."); @@ -22339,7 +23359,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand } return ret_conv; } -LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) { +LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -22348,6 +23368,8 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc } 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); LDKChannelUpdate msg_var = *msg; int64_t msg_ref = 0; msg_var = ChannelUpdate_clone(&msg_var); @@ -22355,7 +23377,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_update_meth, msg_ref); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_update_meth, their_node_id_arr, msg_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to handle_channel_update in LDKRoutingMessageHandler from rust threw an exception."); @@ -22666,11 +23688,11 @@ static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv *en atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "(J)J"); + calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "([BJ)J"); CHECK(calls->handle_node_announcement_meth != NULL); - calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "(J)J"); + calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "([BJ)J"); CHECK(calls->handle_channel_announcement_meth != NULL); - calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "(J)J"); + calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "([BJ)J"); CHECK(calls->handle_channel_update_meth != NULL); calls->get_next_channel_announcement_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcement", "(J)J"); CHECK(calls->get_next_channel_announcement_meth != NULL); @@ -22723,45 +23745,54 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1g LDKRoutingMessageHandler *inp = (LDKRoutingMessageHandler *)untag_ptr(arg); return tag_ptr(&inp->MessageSendEventsProvider, false); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)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); 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_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv); + *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)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); 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_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv); + *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)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); 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_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv); + *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); return tag_ptr(ret_conv, true); } @@ -24073,55 +25104,6 @@ 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; @@ -25669,349 +26651,918 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RetryDecodeErrorZ_ return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv *env, jclass clz) { - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = CResult_NoneAPIErrorZ_ok(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ThirtyTwoBytesZ_1some(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); + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = COption_ThirtyTwoBytesZ_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_1ThirtyTwoBytesZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = COption_ThirtyTwoBytesZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ThirtyTwoBytesZ_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_ThirtyTwoBytesZ _res_conv = *(LDKCOption_ThirtyTwoBytesZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_ThirtyTwoBytesZ_free(_res_conv); +} + +static inline uint64_t COption_ThirtyTwoBytesZ_clone_ptr(LDKCOption_ThirtyTwoBytesZ *NONNULL_PTR arg) { + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = COption_ThirtyTwoBytesZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ThirtyTwoBytesZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_ThirtyTwoBytesZ* arg_conv = (LDKCOption_ThirtyTwoBytesZ*)untag_ptr(arg); + int64_t ret_conv = COption_ThirtyTwoBytesZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ThirtyTwoBytesZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_ThirtyTwoBytesZ* orig_conv = (LDKCOption_ThirtyTwoBytesZ*)untag_ptr(orig); + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = COption_ThirtyTwoBytesZ_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_1CVec_1u8ZZ_1some(JNIEnv *env, jclass clz, int8_tArray o) { + LDKCVec_u8Z o_ref; + o_ref.datalen = (*env)->GetArrayLength(env, o); + o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, o, 0, o_ref.datalen, o_ref.data); + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = COption_CVec_u8ZZ_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_1CVec_1u8ZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = COption_CVec_u8ZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_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_CVec_u8ZZ _res_conv = *(LDKCOption_CVec_u8ZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_CVec_u8ZZ_free(_res_conv); +} + +static inline uint64_t COption_CVec_u8ZZ_clone_ptr(LDKCOption_CVec_u8ZZ *NONNULL_PTR arg) { + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = COption_CVec_u8ZZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_CVec_u8ZZ* arg_conv = (LDKCOption_CVec_u8ZZ*)untag_ptr(arg); + int64_t ret_conv = COption_CVec_u8ZZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_CVec_u8ZZ* orig_conv = (LDKCOption_CVec_u8ZZ*)untag_ptr(orig); + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = COption_CVec_u8ZZ_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_1RecipientOnionFieldsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKRecipientOnionFields 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 = RecipientOnionFields_clone(&o_conv); + LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); + *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)untag_ptr(e)); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = CResult_NoneAPIErrorZ_err(e_conv); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); + *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RecipientOnionFieldsDecodeErrorZ* o_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_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_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr); + LDKCResult_RecipientOnionFieldsDecodeErrorZ _res_conv = *(LDKCResult_RecipientOnionFieldsDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NoneAPIErrorZ_free(_res_conv); + CResult_RecipientOnionFieldsDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) { - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = CResult_NoneAPIErrorZ_clone(arg); +static inline uint64_t CResult_RecipientOnionFieldsDecodeErrorZ_clone_ptr(LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); + *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RecipientOnionFieldsDecodeErrorZ* arg_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(orig); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_RecipientOnionFieldsDecodeErrorZ* orig_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); + *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +static inline uint64_t C2Tuple_u64CVec_u8ZZ_clone_ptr(LDKC2Tuple_u64CVec_u8ZZ *NONNULL_PTR arg) { + LDKC2Tuple_u64CVec_u8ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); + *ret_conv = C2Tuple_u64CVec_u8ZZ_clone(arg); return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64CVec_1u8ZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_u64CVec_u8ZZ* arg_conv = (LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_u64CVec_u8ZZ_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CResult_1NoneAPIErrorZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_CResult_NoneAPIErrorZZ _res_constr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64CVec_1u8ZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_u64CVec_u8ZZ* orig_conv = (LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(orig); + LDKC2Tuple_u64CVec_u8ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); + *ret_conv = C2Tuple_u64CVec_u8ZZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64CVec_1u8ZZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) { + LDKCVec_u8Z b_ref; + b_ref.datalen = (*env)->GetArrayLength(env, b); + b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data); + LDKC2Tuple_u64CVec_u8ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); + *ret_conv = C2Tuple_u64CVec_u8ZZ_new(a, b_ref); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64CVec_1u8ZZ_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_u64CVec_u8ZZ _res_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_u64CVec_u8ZZ_free(_res_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u64CVec_1u8ZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_u64CVec_u8ZZZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t w = 0; w < _res_constr.datalen; w++) { - int64_t _res_conv_22 = _res_vals[w]; - void* _res_conv_22_ptr = untag_ptr(_res_conv_22); - CHECK_ACCESS(_res_conv_22_ptr); - LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr); - FREE(untag_ptr(_res_conv_22)); - _res_constr.data[w] = _res_conv_22_conv; + for (size_t x = 0; x < _res_constr.datalen; x++) { + int64_t _res_conv_23 = _res_vals[x]; + void* _res_conv_23_ptr = untag_ptr(_res_conv_23); + CHECK_ACCESS(_res_conv_23_ptr); + LDKC2Tuple_u64CVec_u8ZZ _res_conv_23_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(_res_conv_23_ptr); + FREE(untag_ptr(_res_conv_23)); + _res_constr.data[x] = _res_conv_23_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_CResult_NoneAPIErrorZZ_free(_res_constr); + CVec_C2Tuple_u64CVec_u8ZZZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKRecipientOnionFields 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 = RecipientOnionFields_clone(&o_conv); + LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); + *ret_conv = CResult_RecipientOnionFieldsNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); + *ret_conv = CResult_RecipientOnionFieldsNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RecipientOnionFieldsNoneZ* o_conv = (LDKCResult_RecipientOnionFieldsNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_RecipientOnionFieldsNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_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_RecipientOnionFieldsNoneZ _res_conv = *(LDKCResult_RecipientOnionFieldsNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RecipientOnionFieldsNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_RecipientOnionFieldsNoneZ_clone_ptr(LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR arg) { + LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); + *ret_conv = CResult_RecipientOnionFieldsNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RecipientOnionFieldsNoneZ* arg_conv = (LDKCResult_RecipientOnionFieldsNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RecipientOnionFieldsNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_RecipientOnionFieldsNoneZ* orig_conv = (LDKCResult_RecipientOnionFieldsNoneZ*)untag_ptr(orig); + LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); + *ret_conv = CResult_RecipientOnionFieldsNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +static inline uint64_t C2Tuple_DNSResolverMessageResponseInstructionZ_clone_ptr(LDKC2Tuple_DNSResolverMessageResponseInstructionZ *NONNULL_PTR arg) { + LDKC2Tuple_DNSResolverMessageResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSResolverMessageResponseInstructionZ), "LDKC2Tuple_DNSResolverMessageResponseInstructionZ"); + *ret_conv = C2Tuple_DNSResolverMessageResponseInstructionZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageResponseInstructionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_DNSResolverMessageResponseInstructionZ* arg_conv = (LDKC2Tuple_DNSResolverMessageResponseInstructionZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_DNSResolverMessageResponseInstructionZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageResponseInstructionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_DNSResolverMessageResponseInstructionZ* orig_conv = (LDKC2Tuple_DNSResolverMessageResponseInstructionZ*)untag_ptr(orig); + LDKC2Tuple_DNSResolverMessageResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSResolverMessageResponseInstructionZ), "LDKC2Tuple_DNSResolverMessageResponseInstructionZ"); + *ret_conv = C2Tuple_DNSResolverMessageResponseInstructionZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageResponseInstructionZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKDNSResolverMessage a_conv = *(LDKDNSResolverMessage*)(a_ptr); + a_conv = DNSResolverMessage_clone((LDKDNSResolverMessage*)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_DNSResolverMessageResponseInstructionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSResolverMessageResponseInstructionZ), "LDKC2Tuple_DNSResolverMessageResponseInstructionZ"); + *ret_conv = C2Tuple_DNSResolverMessageResponseInstructionZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageResponseInstructionZ_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_DNSResolverMessageResponseInstructionZ _res_conv = *(LDKC2Tuple_DNSResolverMessageResponseInstructionZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_DNSResolverMessageResponseInstructionZ_free(_res_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1DNSResolverMessageResponseInstructionZZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_DNSResolverMessageResponseInstructionZ o_conv = *(LDKC2Tuple_DNSResolverMessageResponseInstructionZ*)(o_ptr); + o_conv = C2Tuple_DNSResolverMessageResponseInstructionZ_clone((LDKC2Tuple_DNSResolverMessageResponseInstructionZ*)untag_ptr(o)); + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ), "LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_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_1DNSResolverMessageResponseInstructionZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ), "LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1DNSResolverMessageResponseInstructionZZ_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_DNSResolverMessageResponseInstructionZZ _res_conv = *(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_free(_res_conv); +} + +static inline uint64_t COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_clone_ptr(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ), "LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_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_1DNSResolverMessageResponseInstructionZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ* arg_conv = (LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1DNSResolverMessageResponseInstructionZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ* orig_conv = (LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ), "LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ"); + *ret_copy = COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline uint64_t C2Tuple_DNSResolverMessageMessageSendInstructionsZ_clone_ptr(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ *NONNULL_PTR arg) { + LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ), "LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_DNSResolverMessageMessageSendInstructionsZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageMessageSendInstructionsZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ* arg_conv = (LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_DNSResolverMessageMessageSendInstructionsZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageMessageSendInstructionsZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ* orig_conv = (LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ*)untag_ptr(orig); + LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ), "LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_DNSResolverMessageMessageSendInstructionsZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageMessageSendInstructionsZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKDNSResolverMessage a_conv = *(LDKDNSResolverMessage*)(a_ptr); + a_conv = DNSResolverMessage_clone((LDKDNSResolverMessage*)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_DNSResolverMessageMessageSendInstructionsZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ), "LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ"); + *ret_conv = C2Tuple_DNSResolverMessageMessageSendInstructionsZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageMessageSendInstructionsZ_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_DNSResolverMessageMessageSendInstructionsZ _res_conv = *(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_DNSResolverMessageMessageSendInstructionsZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1APIErrorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_APIErrorZ _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1DNSResolverMessageMessageSendInstructionsZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ), "LDKCVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t k = 0; k < _res_constr.datalen; k++) { - int64_t _res_conv_10 = _res_vals[k]; - void* _res_conv_10_ptr = untag_ptr(_res_conv_10); - CHECK_ACCESS(_res_conv_10_ptr); - LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr); - FREE(untag_ptr(_res_conv_10)); - _res_constr.data[k] = _res_conv_10_conv; + for (size_t b = 0; b < _res_constr.datalen; b++) { + int64_t _res_conv_53 = _res_vals[b]; + void* _res_conv_53_ptr = untag_ptr(_res_conv_53); + CHECK_ACCESS(_res_conv_53_ptr); + LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ _res_conv_53_conv = *(LDKC2Tuple_DNSResolverMessageMessageSendInstructionsZ*)(_res_conv_53_ptr); + FREE(untag_ptr(_res_conv_53)); + _res_constr.data[b] = _res_conv_53_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_APIErrorZ_free(_res_constr); + CVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ThirtyTwoBytesZ_1some(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); - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = COption_ThirtyTwoBytesZ_some(o_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKDNSResolverMessage o_conv = *(LDKDNSResolverMessage*)(o_ptr); + o_conv = DNSResolverMessage_clone((LDKDNSResolverMessage*)untag_ptr(o)); + LDKCResult_DNSResolverMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverMessageDecodeErrorZ), "LDKCResult_DNSResolverMessageDecodeErrorZ"); + *ret_conv = CResult_DNSResolverMessageDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ThirtyTwoBytesZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = COption_ThirtyTwoBytesZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_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_DNSResolverMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverMessageDecodeErrorZ), "LDKCResult_DNSResolverMessageDecodeErrorZ"); + *ret_conv = CResult_DNSResolverMessageDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ThirtyTwoBytesZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_DNSResolverMessageDecodeErrorZ* o_conv = (LDKCResult_DNSResolverMessageDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_DNSResolverMessageDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_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_ThirtyTwoBytesZ _res_conv = *(LDKCOption_ThirtyTwoBytesZ*)(_res_ptr); + LDKCResult_DNSResolverMessageDecodeErrorZ _res_conv = *(LDKCResult_DNSResolverMessageDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_ThirtyTwoBytesZ_free(_res_conv); + CResult_DNSResolverMessageDecodeErrorZ_free(_res_conv); } -static inline uint64_t COption_ThirtyTwoBytesZ_clone_ptr(LDKCOption_ThirtyTwoBytesZ *NONNULL_PTR arg) { - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = COption_ThirtyTwoBytesZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +static inline uint64_t CResult_DNSResolverMessageDecodeErrorZ_clone_ptr(LDKCResult_DNSResolverMessageDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DNSResolverMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverMessageDecodeErrorZ), "LDKCResult_DNSResolverMessageDecodeErrorZ"); + *ret_conv = CResult_DNSResolverMessageDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ThirtyTwoBytesZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_ThirtyTwoBytesZ* arg_conv = (LDKCOption_ThirtyTwoBytesZ*)untag_ptr(arg); - int64_t ret_conv = COption_ThirtyTwoBytesZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_DNSResolverMessageDecodeErrorZ* arg_conv = (LDKCResult_DNSResolverMessageDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_DNSResolverMessageDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ThirtyTwoBytesZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_ThirtyTwoBytesZ* orig_conv = (LDKCOption_ThirtyTwoBytesZ*)untag_ptr(orig); - LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = COption_ThirtyTwoBytesZ_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_1DNSResolverMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_DNSResolverMessageDecodeErrorZ* orig_conv = (LDKCResult_DNSResolverMessageDecodeErrorZ*)untag_ptr(orig); + LDKCResult_DNSResolverMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverMessageDecodeErrorZ), "LDKCResult_DNSResolverMessageDecodeErrorZ"); + *ret_conv = CResult_DNSResolverMessageDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1some(JNIEnv *env, jclass clz, int8_tArray o) { - LDKCVec_u8Z o_ref; - o_ref.datalen = (*env)->GetArrayLength(env, o); - o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, o, 0, o_ref.datalen, o_ref.data); - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = COption_CVec_u8ZZ_some(o_ref); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKHumanReadableName 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 = HumanReadableName_clone(&o_conv); + LDKCResult_HumanReadableNameNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameNoneZ), "LDKCResult_HumanReadableNameNoneZ"); + *ret_conv = CResult_HumanReadableNameNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = COption_CVec_u8ZZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_HumanReadableNameNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameNoneZ), "LDKCResult_HumanReadableNameNoneZ"); + *ret_conv = CResult_HumanReadableNameNoneZ_err(); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HumanReadableNameNoneZ* o_conv = (LDKCResult_HumanReadableNameNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_HumanReadableNameNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_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_CVec_u8ZZ _res_conv = *(LDKCOption_CVec_u8ZZ*)(_res_ptr); + LDKCResult_HumanReadableNameNoneZ _res_conv = *(LDKCResult_HumanReadableNameNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_CVec_u8ZZ_free(_res_conv); + CResult_HumanReadableNameNoneZ_free(_res_conv); } -static inline uint64_t COption_CVec_u8ZZ_clone_ptr(LDKCOption_CVec_u8ZZ *NONNULL_PTR arg) { - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = COption_CVec_u8ZZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +static inline uint64_t CResult_HumanReadableNameNoneZ_clone_ptr(LDKCResult_HumanReadableNameNoneZ *NONNULL_PTR arg) { + LDKCResult_HumanReadableNameNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameNoneZ), "LDKCResult_HumanReadableNameNoneZ"); + *ret_conv = CResult_HumanReadableNameNoneZ_clone(arg); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_CVec_u8ZZ* arg_conv = (LDKCOption_CVec_u8ZZ*)untag_ptr(arg); - int64_t ret_conv = COption_CVec_u8ZZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HumanReadableNameNoneZ* arg_conv = (LDKCResult_HumanReadableNameNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HumanReadableNameNoneZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_CVec_u8ZZ* orig_conv = (LDKCOption_CVec_u8ZZ*)untag_ptr(orig); - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = COption_CVec_u8ZZ_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_1HumanReadableNameNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_HumanReadableNameNoneZ* orig_conv = (LDKCResult_HumanReadableNameNoneZ*)untag_ptr(orig); + LDKCResult_HumanReadableNameNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameNoneZ), "LDKCResult_HumanReadableNameNoneZ"); + *ret_conv = CResult_HumanReadableNameNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKRecipientOnionFields o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKHumanReadableName 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 = RecipientOnionFields_clone(&o_conv); - LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); - *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_ok(o_conv); + o_conv = HumanReadableName_clone(&o_conv); + LDKCResult_HumanReadableNameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameDecodeErrorZ), "LDKCResult_HumanReadableNameDecodeErrorZ"); + *ret_conv = CResult_HumanReadableNameDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_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_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); - *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_err(e_conv); + LDKCResult_HumanReadableNameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameDecodeErrorZ), "LDKCResult_HumanReadableNameDecodeErrorZ"); + *ret_conv = CResult_HumanReadableNameDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_RecipientOnionFieldsDecodeErrorZ* o_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HumanReadableNameDecodeErrorZ* o_conv = (LDKCResult_HumanReadableNameDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HumanReadableNameDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_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_RecipientOnionFieldsDecodeErrorZ _res_conv = *(LDKCResult_RecipientOnionFieldsDecodeErrorZ*)(_res_ptr); + LDKCResult_HumanReadableNameDecodeErrorZ _res_conv = *(LDKCResult_HumanReadableNameDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_RecipientOnionFieldsDecodeErrorZ_free(_res_conv); + CResult_HumanReadableNameDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_RecipientOnionFieldsDecodeErrorZ_clone_ptr(LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); - *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_clone(arg); +static inline uint64_t CResult_HumanReadableNameDecodeErrorZ_clone_ptr(LDKCResult_HumanReadableNameDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HumanReadableNameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameDecodeErrorZ), "LDKCResult_HumanReadableNameDecodeErrorZ"); + *ret_conv = CResult_HumanReadableNameDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_RecipientOnionFieldsDecodeErrorZ* arg_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HumanReadableNameDecodeErrorZ* arg_conv = (LDKCResult_HumanReadableNameDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HumanReadableNameDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_RecipientOnionFieldsDecodeErrorZ* orig_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(orig); - LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); - *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_HumanReadableNameDecodeErrorZ* orig_conv = (LDKCResult_HumanReadableNameDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HumanReadableNameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameDecodeErrorZ), "LDKCResult_HumanReadableNameDecodeErrorZ"); + *ret_conv = CResult_HumanReadableNameDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -static inline uint64_t C2Tuple_u64CVec_u8ZZ_clone_ptr(LDKC2Tuple_u64CVec_u8ZZ *NONNULL_PTR arg) { - LDKC2Tuple_u64CVec_u8ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); - *ret_conv = C2Tuple_u64CVec_u8ZZ_clone(arg); +static inline uint64_t C2Tuple_DNSSECQueryDNSResolverContextZ_clone_ptr(LDKC2Tuple_DNSSECQueryDNSResolverContextZ *NONNULL_PTR arg) { + LDKC2Tuple_DNSSECQueryDNSResolverContextZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSSECQueryDNSResolverContextZ), "LDKC2Tuple_DNSSECQueryDNSResolverContextZ"); + *ret_conv = C2Tuple_DNSSECQueryDNSResolverContextZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64CVec_1u8ZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_u64CVec_u8ZZ* arg_conv = (LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_u64CVec_u8ZZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSSECQueryDNSResolverContextZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_DNSSECQueryDNSResolverContextZ* arg_conv = (LDKC2Tuple_DNSSECQueryDNSResolverContextZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_DNSSECQueryDNSResolverContextZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64CVec_1u8ZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_u64CVec_u8ZZ* orig_conv = (LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(orig); - LDKC2Tuple_u64CVec_u8ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); - *ret_conv = C2Tuple_u64CVec_u8ZZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSSECQueryDNSResolverContextZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_DNSSECQueryDNSResolverContextZ* orig_conv = (LDKC2Tuple_DNSSECQueryDNSResolverContextZ*)untag_ptr(orig); + LDKC2Tuple_DNSSECQueryDNSResolverContextZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSSECQueryDNSResolverContextZ), "LDKC2Tuple_DNSSECQueryDNSResolverContextZ"); + *ret_conv = C2Tuple_DNSSECQueryDNSResolverContextZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64CVec_1u8ZZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) { - LDKCVec_u8Z b_ref; - b_ref.datalen = (*env)->GetArrayLength(env, b); - b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data); - LDKC2Tuple_u64CVec_u8ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); - *ret_conv = C2Tuple_u64CVec_u8ZZ_new(a, b_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSSECQueryDNSResolverContextZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKDNSSECQuery 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 = DNSSECQuery_clone(&a_conv); + LDKDNSResolverContext 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 = DNSResolverContext_clone(&b_conv); + LDKC2Tuple_DNSSECQueryDNSResolverContextZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_DNSSECQueryDNSResolverContextZ), "LDKC2Tuple_DNSSECQueryDNSResolverContextZ"); + *ret_conv = C2Tuple_DNSSECQueryDNSResolverContextZ_new(a_conv, b_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64CVec_1u8ZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSSECQueryDNSResolverContextZ_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_u64CVec_u8ZZ _res_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(_res_ptr); + LDKC2Tuple_DNSSECQueryDNSResolverContextZ _res_conv = *(LDKC2Tuple_DNSSECQueryDNSResolverContextZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_u64CVec_u8ZZ_free(_res_conv); + C2Tuple_DNSSECQueryDNSResolverContextZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u64CVec_1u8ZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_u64CVec_u8ZZZ _res_constr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_DNSSECQueryDNSResolverContextZ o_conv = *(LDKC2Tuple_DNSSECQueryDNSResolverContextZ*)(o_ptr); + o_conv = C2Tuple_DNSSECQueryDNSResolverContextZ_clone((LDKC2Tuple_DNSSECQueryDNSResolverContextZ*)untag_ptr(o)); + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ), "LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ"); + *ret_conv = CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ), "LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ"); + *ret_conv = CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* o_conv = (LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_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_DNSSECQueryDNSResolverContextZNoneZ _res_conv = *(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_clone_ptr(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ), "LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ"); + *ret_conv = CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* arg_conv = (LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* orig_conv = (LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ*)untag_ptr(orig); + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ), "LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ"); + *ret_conv = CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +static inline uint64_t C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone_ptr(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ *NONNULL_PTR arg) { + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ), "LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ"); + *ret_conv = C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HumanReadableNameThirtyTwoBytesZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ* arg_conv = (LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HumanReadableNameThirtyTwoBytesZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ* orig_conv = (LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)untag_ptr(orig); + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ), "LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ"); + *ret_conv = C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HumanReadableNameThirtyTwoBytesZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) { + LDKHumanReadableName 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 = HumanReadableName_clone(&a_conv); + LDKThirtyTwoBytes b_ref; + CHECK((*env)->GetArrayLength(env, b) == 32); + (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data); + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ), "LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ"); + *ret_conv = C2Tuple_HumanReadableNameThirtyTwoBytesZ_new(a_conv, b_ref); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HumanReadableNameThirtyTwoBytesZ_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_HumanReadableNameThirtyTwoBytesZ _res_conv = *(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_HumanReadableNameThirtyTwoBytesZ_free(_res_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ), "LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ 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_23 = _res_vals[x]; - void* _res_conv_23_ptr = untag_ptr(_res_conv_23); - CHECK_ACCESS(_res_conv_23_ptr); - LDKC2Tuple_u64CVec_u8ZZ _res_conv_23_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(_res_conv_23_ptr); - FREE(untag_ptr(_res_conv_23)); - _res_constr.data[x] = _res_conv_23_conv; + for (size_t r = 0; r < _res_constr.datalen; r++) { + int64_t _res_conv_43 = _res_vals[r]; + void* _res_conv_43_ptr = untag_ptr(_res_conv_43); + CHECK_ACCESS(_res_conv_43_ptr); + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ _res_conv_43_conv = *(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)(_res_conv_43_ptr); + FREE(untag_ptr(_res_conv_43)); + _res_constr.data[r] = _res_conv_43_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_u64CVec_u8ZZZ_free(_res_constr); + CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKRecipientOnionFields 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 = RecipientOnionFields_clone(&o_conv); - LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); - *ret_conv = CResult_RecipientOnionFieldsNoneZ_ok(o_conv); +static inline uint64_t C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone_ptr(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ *NONNULL_PTR arg) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ), "LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ"); + *ret_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone(arg); return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ* arg_conv = (LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); - *ret_conv = CResult_RecipientOnionFieldsNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ* orig_conv = (LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ*)untag_ptr(orig); + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ), "LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ"); + *ret_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_RecipientOnionFieldsNoneZ* o_conv = (LDKCResult_RecipientOnionFieldsNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_RecipientOnionFieldsNoneZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZ_1new(JNIEnv *env, jclass clz, int64_tArray a, int64_t b) { + LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ a_constr; + a_constr.datalen = (*env)->GetArrayLength(env, a); + if (a_constr.datalen > 0) + a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ), "LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ Elements"); + else + a_constr.data = NULL; + int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL); + for (size_t r = 0; r < a_constr.datalen; r++) { + int64_t a_conv_43 = a_vals[r]; + void* a_conv_43_ptr = untag_ptr(a_conv_43); + CHECK_ACCESS(a_conv_43_ptr); + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ a_conv_43_conv = *(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)(a_conv_43_ptr); + a_conv_43_conv = C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone((LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)untag_ptr(a_conv_43)); + a_constr.data[r] = a_conv_43_conv; + } + (*env)->ReleaseLongArrayElements(env, a, a_vals, 0); + LDKOffer 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 = Offer_clone(&b_conv); + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ), "LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ"); + *ret_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_new(a_constr, b_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZ_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_RecipientOnionFieldsNoneZ _res_conv = *(LDKCResult_RecipientOnionFieldsNoneZ*)(_res_ptr); + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ _res_conv = *(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_RecipientOnionFieldsNoneZ_free(_res_conv); + C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_free(_res_conv); } -static inline uint64_t CResult_RecipientOnionFieldsNoneZ_clone_ptr(LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR arg) { - LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); - *ret_conv = CResult_RecipientOnionFieldsNoneZ_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ o_conv = *(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ*)(o_ptr); + o_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone((LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ*)untag_ptr(o)); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ"); + *ret_copy = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_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_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ"); + *ret_copy = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ _res_conv = *(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_free(_res_conv); +} + +static inline uint64_t COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_clone_ptr(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ"); + *ret_copy = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_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_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ* arg_conv = (LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ* orig_conv = (LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ"); + *ret_copy = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline uint64_t C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone_ptr(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ *NONNULL_PTR arg) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ), "LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ"); + *ret_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_RecipientOnionFieldsNoneZ* arg_conv = (LDKCResult_RecipientOnionFieldsNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_RecipientOnionFieldsNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ* arg_conv = (LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_RecipientOnionFieldsNoneZ* orig_conv = (LDKCResult_RecipientOnionFieldsNoneZ*)untag_ptr(orig); - LDKCResult_RecipientOnionFieldsNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsNoneZ), "LDKCResult_RecipientOnionFieldsNoneZ"); - *ret_conv = CResult_RecipientOnionFieldsNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ* orig_conv = (LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ*)untag_ptr(orig); + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ), "LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ"); + *ret_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZ_1new(JNIEnv *env, jclass clz, int64_tArray a, jstring b) { + LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ a_constr; + a_constr.datalen = (*env)->GetArrayLength(env, a); + if (a_constr.datalen > 0) + a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ), "LDKCVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ Elements"); + else + a_constr.data = NULL; + int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL); + for (size_t r = 0; r < a_constr.datalen; r++) { + int64_t a_conv_43 = a_vals[r]; + void* a_conv_43_ptr = untag_ptr(a_conv_43); + CHECK_ACCESS(a_conv_43_ptr); + LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ a_conv_43_conv = *(LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)(a_conv_43_ptr); + a_conv_43_conv = C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone((LDKC2Tuple_HumanReadableNameThirtyTwoBytesZ*)untag_ptr(a_conv_43)); + a_constr.data[r] = a_conv_43_conv; + } + (*env)->ReleaseLongArrayElements(env, a, a_vals, 0); + LDKStr b_conv = java_to_owned_str(env, b); + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ), "LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ"); + *ret_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_new(a_constr, b_conv); return tag_ptr(ret_conv, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZ_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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ _res_conv = *(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_free(_res_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ o_conv = *(LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ*)(o_ptr); + o_conv = C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone((LDKC2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ*)untag_ptr(o)); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ"); + *ret_copy = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_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_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ"); + *ret_copy = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_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_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ _res_conv = *(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_free(_res_conv); +} + +static inline uint64_t COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_clone_ptr(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ"); + *ret_copy = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_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_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ* arg_conv = (LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ* orig_conv = (LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ"); + *ret_copy = COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_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_1UnsignedBolt12InvoiceBolt12SemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKUnsignedBolt12Invoice o_conv; o_conv.inner = untag_ptr(o); @@ -26162,6 +27713,26 @@ 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_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(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ 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]; + 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_BlindedPaymentPathZ_free(_res_constr); +} + 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); @@ -27924,26 +29495,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErro return tag_ptr(ret_conv, true); } -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(LDKBlindedPaymentPath), "LDKCVec_BlindedPaymentPathZ 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]; - 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_BlindedPaymentPathZ_free(_res_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); @@ -28006,155 +29557,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPayme return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { - LDKCVec_PublicKeyZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - _res_constr.data = NULL; - for (size_t i = 0; i < _res_constr.datalen; i++) { - int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i); - LDKPublicKey _res_conv_8_ref; - CHECK((*env)->GetArrayLength(env, _res_conv_8) == 33); - (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 33, _res_conv_8_ref.compressed_form); - _res_constr.data[i] = _res_conv_8_ref; - } - CVec_PublicKeyZ_free(_res_constr); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKOnionMessagePath 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 = OnionMessagePath_clone(&o_conv); - LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); - *ret_conv = CResult_OnionMessagePathNoneZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); - *ret_conv = CResult_OnionMessagePathNoneZ_err(); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_OnionMessagePathNoneZ* o_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_OnionMessagePathNoneZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_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_OnionMessagePathNoneZ _res_conv = *(LDKCResult_OnionMessagePathNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_OnionMessagePathNoneZ_free(_res_conv); -} - -static inline uint64_t CResult_OnionMessagePathNoneZ_clone_ptr(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR arg) { - LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); - *ret_conv = CResult_OnionMessagePathNoneZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_OnionMessagePathNoneZ* arg_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_OnionMessagePathNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_OnionMessagePathNoneZ* orig_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(orig); - LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); - *ret_conv = CResult_OnionMessagePathNoneZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -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(LDKBlindedMessagePath), "LDKCVec_BlindedMessagePathZ Elements"); - else - o_constr.data = NULL; - int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL); - 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_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_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_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_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_BlindedMessagePathZNoneZ _res_conv = *(LDKCResult_CVec_BlindedMessagePathZNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_CVec_BlindedMessagePathZNoneZ_free(_res_conv); -} - -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_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_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); @@ -28683,6 +30085,23 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecode return tag_ptr(ret_conv, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { + LDKCVec_PublicKeyZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); + else + _res_constr.data = NULL; + for (size_t i = 0; i < _res_constr.datalen; i++) { + int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i); + LDKPublicKey _res_conv_8_ref; + CHECK((*env)->GetArrayLength(env, _res_conv_8) == 33); + (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 33, _res_conv_8_ref.compressed_form); + _res_constr.data[i] = _res_conv_8_ref; + } + CVec_PublicKeyZ_free(_res_constr); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKFixedPenaltyScorer o_conv; o_conv.inner = untag_ptr(o); @@ -29306,384 +30725,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C4Tuple_1OutPointChannel CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1ok(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 = InitFeatures_clone(&o_conv); - LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_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_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_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_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_InitFeaturesDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_InitFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_InitFeaturesDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_InitFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1ok(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 = ChannelFeatures_clone(&o_conv); - LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_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_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_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_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ChannelFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ChannelFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1ok(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 = NodeFeatures_clone(&o_conv); - LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_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_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_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_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_NodeFeaturesDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NodeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NodeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1ok(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 = Bolt11InvoiceFeatures_clone(&o_conv); - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_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_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_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_Bolt11InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1ok(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 = Bolt12InvoiceFeatures_clone(&o_conv); - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_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_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_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_Bolt12InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1ok(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 = BlindedHopFeatures_clone(&o_conv); - LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); - *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_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_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); - *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_BlindedHopFeaturesDecodeErrorZ* o_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_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_BlindedHopFeaturesDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopFeaturesDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_BlindedHopFeaturesDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); - *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_BlindedHopFeaturesDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_BlindedHopFeaturesDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); - *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1ok(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 = ChannelTypeFeatures_clone(&o_conv); - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_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_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_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_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferIdDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKOfferId o_conv; o_conv.inner = untag_ptr(o); @@ -29835,72 +30876,38 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferBolt12Semanti return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKInvoiceRequestWithDerivedPayerIdBuilder o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder - LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ"); - *ret_conv = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(o_conv); + LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_java(env, e); - LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ"); - *ret_conv = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(e_conv); + LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_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_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ _res_conv = *(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)(_res_ptr); + LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ _res_conv = *(LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(_res_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKInvoiceRequestWithExplicitPayerIdBuilder o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder - - LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); - *ret_conv = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_java(env, e); - LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); - *ret_conv = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_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_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ _res_conv = *(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(_res_conv); + CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_free(_res_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { @@ -31469,52 +32476,52 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RecentPaymentDetailsZ_1f CVec_RecentPaymentDetailsZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv *env, jclass clz) { - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = CResult_NonePaymentSendFailureZ_ok(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_ok(); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); - e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e)); - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv); + LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); + e_conv = APIError_clone((LDKAPIError*)untag_ptr(e)); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(o); - jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_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_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr); + LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NonePaymentSendFailureZ_free(_res_conv); + CResult_NoneAPIErrorZ_free(_res_conv); } -static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) { - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg); +static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(orig); - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(orig); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -31564,55 +32571,99 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendF return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_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_ThirtyTwoBytesPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ), "LDKCResult_ThirtyTwoBytesPaymentSendFailureZ"); - *ret_conv = CResult_ThirtyTwoBytesPaymentSendFailureZ_ok(o_ref); +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); + 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; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneBolt12PaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12PaymentErrorZ), "LDKCResult_NoneBolt12PaymentErrorZ"); + *ret_conv = CResult_NoneBolt12PaymentErrorZ_ok(); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); - e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e)); - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ), "LDKCResult_ThirtyTwoBytesPaymentSendFailureZ"); - *ret_conv = CResult_ThirtyTwoBytesPaymentSendFailureZ_err(e_conv); + LDKBolt12PaymentError e_conv = *(LDKBolt12PaymentError*)(e_ptr); + e_conv = Bolt12PaymentError_clone((LDKBolt12PaymentError*)untag_ptr(e)); + LDKCResult_NoneBolt12PaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12PaymentErrorZ), "LDKCResult_NoneBolt12PaymentErrorZ"); + *ret_conv = CResult_NoneBolt12PaymentErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* o_conv = (LDKCResult_ThirtyTwoBytesPaymentSendFailureZ*)untag_ptr(o); - jboolean ret_conv = CResult_ThirtyTwoBytesPaymentSendFailureZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneBolt12PaymentErrorZ* o_conv = (LDKCResult_NoneBolt12PaymentErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneBolt12PaymentErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_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_ThirtyTwoBytesPaymentSendFailureZ _res_conv = *(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ*)(_res_ptr); + LDKCResult_NoneBolt12PaymentErrorZ _res_conv = *(LDKCResult_NoneBolt12PaymentErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ThirtyTwoBytesPaymentSendFailureZ_free(_res_conv); + CResult_NoneBolt12PaymentErrorZ_free(_res_conv); } -static inline uint64_t CResult_ThirtyTwoBytesPaymentSendFailureZ_clone_ptr(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR arg) { - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ), "LDKCResult_ThirtyTwoBytesPaymentSendFailureZ"); - *ret_conv = CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(arg); +static inline uint64_t CResult_NoneBolt12PaymentErrorZ_clone_ptr(LDKCResult_NoneBolt12PaymentErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneBolt12PaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12PaymentErrorZ), "LDKCResult_NoneBolt12PaymentErrorZ"); + *ret_conv = CResult_NoneBolt12PaymentErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* arg_conv = (LDKCResult_ThirtyTwoBytesPaymentSendFailureZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ThirtyTwoBytesPaymentSendFailureZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneBolt12PaymentErrorZ* arg_conv = (LDKCResult_NoneBolt12PaymentErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneBolt12PaymentErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* orig_conv = (LDKCResult_ThirtyTwoBytesPaymentSendFailureZ*)untag_ptr(orig); - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ), "LDKCResult_ThirtyTwoBytesPaymentSendFailureZ"); - *ret_conv = CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NoneBolt12PaymentErrorZ* orig_conv = (LDKCResult_NoneBolt12PaymentErrorZ*)untag_ptr(orig); + LDKCResult_NoneBolt12PaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12PaymentErrorZ), "LDKCResult_NoneBolt12PaymentErrorZ"); + *ret_conv = CResult_NoneBolt12PaymentErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -31704,56 +32755,56 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ThirtyTwoBytesThirtyT C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1ok(JNIEnv *env, jclass clz, int64_t o) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1ok(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o_conv = *(LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ*)(o_ptr); o_conv = C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone((LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ*)untag_ptr(o)); - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ"); - *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(o_conv); + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ"); + *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); - e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e)); - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ"); - *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_err(e_conv); + LDKProbeSendFailure e_conv = *(LDKProbeSendFailure*)(e_ptr); + e_conv = ProbeSendFailure_clone((LDKProbeSendFailure*)untag_ptr(e)); + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ"); + *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ*)untag_ptr(o); - jboolean ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* o_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ*)untag_ptr(o); + jboolean ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_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_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ*)(_res_ptr); + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ _res_conv = *(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free(_res_conv); + CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_free(_res_conv); } -static inline uint64_t CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ"); - *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(arg); +static inline uint64_t CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_clone_ptr(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ"); + *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ*)untag_ptr(arg); - int64_t ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* arg_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ*)untag_ptr(arg); + int64_t ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ*)untag_ptr(orig); - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ"); - *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* orig_conv = (LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ*)untag_ptr(orig); + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ"); + *ret_conv = CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -31923,6 +32974,148 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelIdZ_1free(JNIEnv CVec_ChannelIdZ_free(_res_constr); } +static inline uint64_t C2Tuple_PublicKeyChannelIdZ_clone_ptr(LDKC2Tuple_PublicKeyChannelIdZ *NONNULL_PTR arg) { + LDKC2Tuple_PublicKeyChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyChannelIdZ), "LDKC2Tuple_PublicKeyChannelIdZ"); + *ret_conv = C2Tuple_PublicKeyChannelIdZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyChannelIdZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_PublicKeyChannelIdZ* arg_conv = (LDKC2Tuple_PublicKeyChannelIdZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_PublicKeyChannelIdZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyChannelIdZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_PublicKeyChannelIdZ* orig_conv = (LDKC2Tuple_PublicKeyChannelIdZ*)untag_ptr(orig); + LDKC2Tuple_PublicKeyChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyChannelIdZ), "LDKC2Tuple_PublicKeyChannelIdZ"); + *ret_conv = C2Tuple_PublicKeyChannelIdZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyChannelIdZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) { + LDKPublicKey a_ref; + CHECK((*env)->GetArrayLength(env, a) == 33); + (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form); + 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 = ChannelId_clone(&b_conv); + LDKC2Tuple_PublicKeyChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyChannelIdZ), "LDKC2Tuple_PublicKeyChannelIdZ"); + *ret_conv = C2Tuple_PublicKeyChannelIdZ_new(a_ref, b_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyChannelIdZ_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_PublicKeyChannelIdZ _res_conv = *(LDKC2Tuple_PublicKeyChannelIdZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_PublicKeyChannelIdZ_free(_res_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1PublicKeyChannelIdZZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_PublicKeyChannelIdZ o_conv = *(LDKC2Tuple_PublicKeyChannelIdZ*)(o_ptr); + o_conv = C2Tuple_PublicKeyChannelIdZ_clone((LDKC2Tuple_PublicKeyChannelIdZ*)untag_ptr(o)); + LDKCOption_C2Tuple_PublicKeyChannelIdZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_PublicKeyChannelIdZZ), "LDKCOption_C2Tuple_PublicKeyChannelIdZZ"); + *ret_copy = COption_C2Tuple_PublicKeyChannelIdZZ_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_1PublicKeyChannelIdZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_PublicKeyChannelIdZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_PublicKeyChannelIdZZ), "LDKCOption_C2Tuple_PublicKeyChannelIdZZ"); + *ret_copy = COption_C2Tuple_PublicKeyChannelIdZZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1PublicKeyChannelIdZZ_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_PublicKeyChannelIdZZ _res_conv = *(LDKCOption_C2Tuple_PublicKeyChannelIdZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_C2Tuple_PublicKeyChannelIdZZ_free(_res_conv); +} + +static inline uint64_t COption_C2Tuple_PublicKeyChannelIdZZ_clone_ptr(LDKCOption_C2Tuple_PublicKeyChannelIdZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_PublicKeyChannelIdZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_PublicKeyChannelIdZZ), "LDKCOption_C2Tuple_PublicKeyChannelIdZZ"); + *ret_copy = COption_C2Tuple_PublicKeyChannelIdZZ_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_1PublicKeyChannelIdZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_PublicKeyChannelIdZZ* arg_conv = (LDKCOption_C2Tuple_PublicKeyChannelIdZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_PublicKeyChannelIdZZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1PublicKeyChannelIdZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_C2Tuple_PublicKeyChannelIdZZ* orig_conv = (LDKCOption_C2Tuple_PublicKeyChannelIdZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_PublicKeyChannelIdZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_PublicKeyChannelIdZZ), "LDKCOption_C2Tuple_PublicKeyChannelIdZZ"); + *ret_copy = COption_C2Tuple_PublicKeyChannelIdZZ_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_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_CResult_1OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKOfferWithDerivedMetadataBuilder o_conv; o_conv.inner = untag_ptr(o); @@ -32018,6 +33211,26 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1StrZ_1clone(JNIEnv return ret_ref; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1DestinationZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_DestinationZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKDestination), "LDKCVec_DestinationZ 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]; + void* _res_conv_13_ptr = untag_ptr(_res_conv_13); + CHECK_ACCESS(_res_conv_13_ptr); + LDKDestination _res_conv_13_conv = *(LDKDestination*)(_res_conv_13_ptr); + FREE(untag_ptr(_res_conv_13)); + _res_constr.data[n] = _res_conv_13_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_DestinationZ_free(_res_constr); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -32119,53 +33332,6 @@ 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_1OffersContextZ_1some(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)); - 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); @@ -33643,6 +34809,39 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1ThirtyTwoBytesC CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr); } +static inline uint64_t C2Tuple_boolboolZ_clone_ptr(LDKC2Tuple_boolboolZ *NONNULL_PTR arg) { + LDKC2Tuple_boolboolZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_boolboolZ), "LDKC2Tuple_boolboolZ"); + *ret_conv = C2Tuple_boolboolZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1boolboolZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_boolboolZ* arg_conv = (LDKC2Tuple_boolboolZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_boolboolZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1boolboolZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_boolboolZ* orig_conv = (LDKC2Tuple_boolboolZ*)untag_ptr(orig); + LDKC2Tuple_boolboolZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_boolboolZ), "LDKC2Tuple_boolboolZ"); + *ret_conv = C2Tuple_boolboolZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1boolboolZ_1new(JNIEnv *env, jclass clz, jboolean a, jboolean b) { + LDKC2Tuple_boolboolZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_boolboolZ), "LDKC2Tuple_boolboolZ"); + *ret_conv = C2Tuple_boolboolZ_new(a, b); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1boolboolZ_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_boolboolZ _res_conv = *(LDKC2Tuple_boolboolZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_boolboolZ_free(_res_conv); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BalanceZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { LDKCVec_BalanceZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); @@ -34541,6 +35740,124 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1StrZIOErrorZ return tag_ptr(ret_conv, true); } +static inline uint64_t C3Tuple_StrStrStrZ_clone_ptr(LDKC3Tuple_StrStrStrZ *NONNULL_PTR arg) { + LDKC3Tuple_StrStrStrZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_StrStrStrZ), "LDKC3Tuple_StrStrStrZ"); + *ret_conv = C3Tuple_StrStrStrZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC3Tuple_StrStrStrZ* arg_conv = (LDKC3Tuple_StrStrStrZ*)untag_ptr(arg); + int64_t ret_conv = C3Tuple_StrStrStrZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC3Tuple_StrStrStrZ* orig_conv = (LDKC3Tuple_StrStrStrZ*)untag_ptr(orig); + LDKC3Tuple_StrStrStrZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_StrStrStrZ), "LDKC3Tuple_StrStrStrZ"); + *ret_conv = C3Tuple_StrStrStrZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1new(JNIEnv *env, jclass clz, jstring a, jstring b, jstring c) { + LDKStr a_conv = java_to_owned_str(env, a); + LDKStr b_conv = java_to_owned_str(env, b); + LDKStr c_conv = java_to_owned_str(env, c); + LDKC3Tuple_StrStrStrZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_StrStrStrZ), "LDKC3Tuple_StrStrStrZ"); + *ret_conv = C3Tuple_StrStrStrZ_new(a_conv, b_conv, c_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_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_StrStrStrZ _res_conv = *(LDKC3Tuple_StrStrStrZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C3Tuple_StrStrStrZ_free(_res_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1StrStrStrZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C3Tuple_StrStrStrZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_StrStrStrZ), "LDKCVec_C3Tuple_StrStrStrZZ 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_23 = _res_vals[x]; + void* _res_conv_23_ptr = untag_ptr(_res_conv_23); + CHECK_ACCESS(_res_conv_23_ptr); + LDKC3Tuple_StrStrStrZ _res_conv_23_conv = *(LDKC3Tuple_StrStrStrZ*)(_res_conv_23_ptr); + FREE(untag_ptr(_res_conv_23)); + _res_constr.data[x] = _res_conv_23_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C3Tuple_StrStrStrZZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1ok(JNIEnv *env, jclass clz, int64_tArray o) { + LDKCVec_C3Tuple_StrStrStrZZ o_constr; + o_constr.datalen = (*env)->GetArrayLength(env, o); + if (o_constr.datalen > 0) + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKC3Tuple_StrStrStrZ), "LDKCVec_C3Tuple_StrStrStrZZ Elements"); + else + o_constr.data = NULL; + int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL); + for (size_t x = 0; x < o_constr.datalen; x++) { + int64_t o_conv_23 = o_vals[x]; + void* o_conv_23_ptr = untag_ptr(o_conv_23); + CHECK_ACCESS(o_conv_23_ptr); + LDKC3Tuple_StrStrStrZ o_conv_23_conv = *(LDKC3Tuple_StrStrStrZ*)(o_conv_23_ptr); + o_conv_23_conv = C3Tuple_StrStrStrZ_clone((LDKC3Tuple_StrStrStrZ*)untag_ptr(o_conv_23)); + o_constr.data[x] = o_conv_23_conv; + } + (*env)->ReleaseLongArrayElements(env, o, o_vals, 0); + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ), "LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ"); + *ret_conv = CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_ok(o_constr); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKIOError e_conv = LDKIOError_from_java(env, e); + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ), "LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ"); + *ret_conv = CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* o_conv = (LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_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_C3Tuple_StrStrStrZZIOErrorZ _res_conv = *(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_clone_ptr(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ *NONNULL_PTR arg) { + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ), "LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ"); + *ret_conv = CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* arg_conv = (LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* orig_conv = (LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ*)untag_ptr(orig); + LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ), "LDKCResult_CVec_C3Tuple_StrStrStrZZIOErrorZ"); + *ret_conv = CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1ThirtyTwoBytesChannelMonitorZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); @@ -34673,55 +35990,72 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwo return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKUnsignedInvoiceRequest o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1MonitorNameIOErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKMonitorName 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 = UnsignedInvoiceRequest_clone(&o_conv); - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); - *ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(o_conv); + // WARNING: we need a move here but no clone is available for LDKMonitorName + + LDKCResult_MonitorNameIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MonitorNameIOErrorZ), "LDKCResult_MonitorNameIOErrorZ"); + *ret_conv = CResult_MonitorNameIOErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_java(env, e); - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); - *ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1MonitorNameIOErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKIOError e_conv = LDKIOError_from_java(env, e); + LDKCResult_MonitorNameIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MonitorNameIOErrorZ), "LDKCResult_MonitorNameIOErrorZ"); + *ret_conv = CResult_MonitorNameIOErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* o_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1MonitorNameIOErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_MonitorNameIOErrorZ* o_conv = (LDKCResult_MonitorNameIOErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_MonitorNameIOErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1MonitorNameIOErrorZ_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_UnsignedInvoiceRequestBolt12SemanticErrorZ _res_conv = *(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)(_res_ptr); + LDKCResult_MonitorNameIOErrorZ _res_conv = *(LDKCResult_MonitorNameIOErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(_res_conv); + CResult_MonitorNameIOErrorZ_free(_res_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateNameIOErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKUpdateName o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + // WARNING: we need a move here but no clone is available for LDKUpdateName + + LDKCResult_UpdateNameIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateNameIOErrorZ), "LDKCResult_UpdateNameIOErrorZ"); + *ret_conv = CResult_UpdateNameIOErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -static inline uint64_t CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); - *ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateNameIOErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKIOError e_conv = LDKIOError_from_java(env, e); + LDKCResult_UpdateNameIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateNameIOErrorZ), "LDKCResult_UpdateNameIOErrorZ"); + *ret_conv = CResult_UpdateNameIOErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* arg_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateNameIOErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UpdateNameIOErrorZ* o_conv = (LDKCResult_UpdateNameIOErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_UpdateNameIOErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* orig_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(orig); - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); - *ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateNameIOErrorZ_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_UpdateNameIOErrorZ _res_conv = *(LDKCResult_UpdateNameIOErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_UpdateNameIOErrorZ_free(_res_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestBolt12SemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { @@ -34893,6 +36227,60 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceWithDerivedSig CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(_res_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKInvoiceRequest 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 = InvoiceRequest_clone(&o_conv); + LDKCResult_InvoiceRequestDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestDecodeErrorZ), "LDKCResult_InvoiceRequestDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_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_InvoiceRequestDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestDecodeErrorZ), "LDKCResult_InvoiceRequestDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceRequestDecodeErrorZ* o_conv = (LDKCResult_InvoiceRequestDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_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_InvoiceRequestDecodeErrorZ _res_conv = *(LDKCResult_InvoiceRequestDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceRequestDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_InvoiceRequestDecodeErrorZ_clone_ptr(LDKCResult_InvoiceRequestDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceRequestDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestDecodeErrorZ), "LDKCResult_InvoiceRequestDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceRequestDecodeErrorZ* arg_conv = (LDKCResult_InvoiceRequestDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceRequestDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_InvoiceRequestDecodeErrorZ* orig_conv = (LDKCResult_InvoiceRequestDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InvoiceRequestDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestDecodeErrorZ), "LDKCResult_InvoiceRequestDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFieldsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKInvoiceRequestFields o_conv; o_conv.inner = untag_ptr(o); @@ -40503,10 +41891,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixBolt11Pars } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixBolt11ParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKBolt11ParseError e_conv = *(LDKBolt11ParseError*)(e_ptr); - e_conv = Bolt11ParseError_clone((LDKBolt11ParseError*)untag_ptr(e)); + LDKBolt11ParseError 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 = Bolt11ParseError_clone(&e_conv); LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -40611,10 +42000,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawBolt11Inv } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawBolt11InvoiceBolt11ParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKBolt11ParseError e_conv = *(LDKBolt11ParseError*)(e_ptr); - e_conv = Bolt11ParseError_clone((LDKBolt11ParseError*)untag_ptr(e)); + LDKBolt11ParseError 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 = Bolt11ParseError_clone(&e_conv); LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -41394,6 +42784,384 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelIdDecodeErr return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1ok(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 = InitFeatures_clone(&o_conv); + LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_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_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_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_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InitFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InitFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InitFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_InitFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1ok(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 = ChannelFeatures_clone(&o_conv); + LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_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_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_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_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ChannelFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1ok(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 = NodeFeatures_clone(&o_conv); + LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_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_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_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_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NodeFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NodeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1ok(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 = Bolt11InvoiceFeatures_clone(&o_conv); + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_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_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_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_Bolt11InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1ok(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 = Bolt12InvoiceFeatures_clone(&o_conv); + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_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_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_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_Bolt12InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ), "LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1ok(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 = BlindedHopFeatures_clone(&o_conv); + LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); + *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_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_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); + *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BlindedHopFeaturesDecodeErrorZ* o_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_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_BlindedHopFeaturesDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopFeaturesDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedHopFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); + *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BlindedHopFeaturesDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_BlindedHopFeaturesDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ"); + *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1ok(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 = ChannelTypeFeatures_clone(&o_conv); + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_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_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_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_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + static inline uint64_t C2Tuple__u832u16Z_clone_ptr(LDKC2Tuple__u832u16Z *NONNULL_PTR arg) { LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); *ret_conv = C2Tuple__u832u16Z_clone(arg); @@ -41715,60 +43483,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentContextDeco return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKUnknownPaymentContext 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 = UnknownPaymentContext_clone(&o_conv); - LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); - *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_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_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); - *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* o_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_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_UnknownPaymentContextDecodeErrorZ _res_conv = *(LDKCResult_UnknownPaymentContextDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_UnknownPaymentContextDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); - *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* arg_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_UnknownPaymentContextDecodeErrorZ* orig_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(orig); - LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); - *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12OfferContextDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKBolt12OfferContext o_conv; o_conv.inner = untag_ptr(o); @@ -41981,6 +43695,138 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErr return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKOnionMessagePath 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 = OnionMessagePath_clone(&o_conv); + LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); + *ret_conv = CResult_OnionMessagePathNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); + *ret_conv = CResult_OnionMessagePathNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_OnionMessagePathNoneZ* o_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_OnionMessagePathNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_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_OnionMessagePathNoneZ _res_conv = *(LDKCResult_OnionMessagePathNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OnionMessagePathNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_OnionMessagePathNoneZ_clone_ptr(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR arg) { + LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); + *ret_conv = CResult_OnionMessagePathNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_OnionMessagePathNoneZ* arg_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OnionMessagePathNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_OnionMessagePathNoneZ* orig_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(orig); + LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); + *ret_conv = CResult_OnionMessagePathNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +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(LDKBlindedMessagePath), "LDKCVec_BlindedMessagePathZ Elements"); + else + o_constr.data = NULL; + int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL); + 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_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_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_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_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_BlindedMessagePathZNoneZ _res_conv = *(LDKCResult_CVec_BlindedMessagePathZNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_CVec_BlindedMessagePathZNoneZ_free(_res_conv); +} + +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_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_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_COption_1MessageContextZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -42351,60 +44197,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PhantomRouteHintsZ_1free 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_CResult_1InvoiceErrorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKInvoiceError o_conv; o_conv.inner = untag_ptr(o); @@ -43414,6 +45206,113 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecod return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKAsyncPaymentsContext o_conv = *(LDKAsyncPaymentsContext*)(o_ptr); + o_conv = AsyncPaymentsContext_clone((LDKAsyncPaymentsContext*)untag_ptr(o)); + LDKCResult_AsyncPaymentsContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsContextDecodeErrorZ), "LDKCResult_AsyncPaymentsContextDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsContextDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_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_AsyncPaymentsContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsContextDecodeErrorZ), "LDKCResult_AsyncPaymentsContextDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_AsyncPaymentsContextDecodeErrorZ* o_conv = (LDKCResult_AsyncPaymentsContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_AsyncPaymentsContextDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_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_AsyncPaymentsContextDecodeErrorZ _res_conv = *(LDKCResult_AsyncPaymentsContextDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_AsyncPaymentsContextDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_AsyncPaymentsContextDecodeErrorZ_clone_ptr(LDKCResult_AsyncPaymentsContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_AsyncPaymentsContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsContextDecodeErrorZ), "LDKCResult_AsyncPaymentsContextDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsContextDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_AsyncPaymentsContextDecodeErrorZ* arg_conv = (LDKCResult_AsyncPaymentsContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_AsyncPaymentsContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_AsyncPaymentsContextDecodeErrorZ* orig_conv = (LDKCResult_AsyncPaymentsContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_AsyncPaymentsContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsContextDecodeErrorZ), "LDKCResult_AsyncPaymentsContextDecodeErrorZ"); + *ret_conv = CResult_AsyncPaymentsContextDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKDNSResolverContext 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 = DNSResolverContext_clone(&o_conv); + LDKCResult_DNSResolverContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverContextDecodeErrorZ), "LDKCResult_DNSResolverContextDecodeErrorZ"); + *ret_conv = CResult_DNSResolverContextDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_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_DNSResolverContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverContextDecodeErrorZ), "LDKCResult_DNSResolverContextDecodeErrorZ"); + *ret_conv = CResult_DNSResolverContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_DNSResolverContextDecodeErrorZ* o_conv = (LDKCResult_DNSResolverContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_DNSResolverContextDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_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_DNSResolverContextDecodeErrorZ _res_conv = *(LDKCResult_DNSResolverContextDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_DNSResolverContextDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_DNSResolverContextDecodeErrorZ_clone_ptr(LDKCResult_DNSResolverContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DNSResolverContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverContextDecodeErrorZ), "LDKCResult_DNSResolverContextDecodeErrorZ"); + *ret_conv = CResult_DNSResolverContextDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_DNSResolverContextDecodeErrorZ* arg_conv = (LDKCResult_DNSResolverContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_DNSResolverContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_DNSResolverContextDecodeErrorZ* orig_conv = (LDKCResult_DNSResolverContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_DNSResolverContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverContextDecodeErrorZ), "LDKCResult_DNSResolverContextDecodeErrorZ"); + *ret_conv = CResult_DNSResolverContextDecodeErrorZ_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) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -43935,6 +45834,27 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KVStore_1free(JNIEnv *env, jcl KVStore_free(this_ptr_conv); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MigratableKVStore_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); + LDKMigratableKVStore this_ptr_conv = *(LDKMigratableKVStore*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MigratableKVStore_free(this_ptr_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_migrate_1kv_1store_1data(JNIEnv *env, jclass clz, int64_t source_store, int64_t target_store) { + void* source_store_ptr = untag_ptr(source_store); + if (ptr_is_owned(source_store)) { CHECK_ACCESS(source_store_ptr); } + LDKMigratableKVStore* source_store_conv = (LDKMigratableKVStore*)source_store_ptr; + void* target_store_ptr = untag_ptr(target_store); + if (ptr_is_owned(target_store)) { CHECK_ACCESS(target_store_ptr); } + LDKMigratableKVStore* target_store_conv = (LDKMigratableKVStore*)target_store_ptr; + LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); + *ret_conv = migrate_kv_store_data(source_store_conv, target_store_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persister_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -44074,6 +45994,79 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1a return tag_ptr(ret_ret, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorName_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKMonitorName this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + MonitorName_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorName_1new(JNIEnv *env, jclass clz, jstring name) { + LDKStr name_conv = java_to_owned_str(env, name); + LDKCResult_MonitorNameIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MonitorNameIOErrorZ), "LDKCResult_MonitorNameIOErrorZ"); + *ret_conv = MonitorName_new(name_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_MonitorName_1as_1str(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKMonitorName this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = MonitorName_as_str(&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 void JNICALL Java_org_ldk_impl_bindings_UpdateName_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUpdateName this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + UpdateName_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateName_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateName this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = UpdateName_get_a(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateName_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUpdateName this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + UpdateName_set_a(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateName_1new(JNIEnv *env, jclass clz, jstring name) { + LDKStr name_conv = java_to_owned_str(env, name); + LDKCResult_UpdateNameIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateNameIOErrorZ), "LDKCResult_UpdateNameIOErrorZ"); + *ret_conv = UpdateName_new(name_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_UpdateName_1as_1str(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUpdateName this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = UpdateName_as_str(&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 jclass JNICALL Java_org_ldk_impl_bindings_ShortChannelIdError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKShortChannelIdError* orig_conv = (LDKShortChannelIdError*)untag_ptr(orig); jclass ret_conv = LDKShortChannelIdError_to_java(env, ShortChannelIdError_clone(orig_conv)); @@ -46332,25 +48325,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1inter UserConfig_set_accept_intercept_htlcs(&this_ptr_conv, val); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1mpp_1keysend(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_accept_mpp_keysend(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1mpp_1keysend(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_accept_mpp_keysend(&this_ptr_conv, val); -} - 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); @@ -46370,7 +48344,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1manually_1han 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) { +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 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); @@ -46386,7 +48360,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, manually_handle_bolt12_invoices_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, 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); @@ -47764,7 +49738,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1a return ret_arr; } -JNIEXPORT int64_t 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, int64_t logger) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -47773,8 +49747,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1process_1pe void* handler_ptr = untag_ptr(handler); if (ptr_is_owned(handler)) { CHECK_ACCESS(handler_ptr); } LDKEventHandler* handler_conv = (LDKEventHandler*)handler_ptr; + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; LDKCResult_NoneReplayEventZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneReplayEventZ), "LDKCResult_NoneReplayEventZ"); - *ret_conv = ChannelMonitor_process_pending_events(&this_arg_conv, handler_conv); + *ret_conv = ChannelMonitor_process_pending_events(&this_arg_conv, handler_conv, logger_conv); return tag_ptr(ret_conv, true); } @@ -48199,7 +50176,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1s return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1is_1fully_1resolved(JNIEnv *env, jclass clz, int64_t this_arg, int64_t logger) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1check_1and_1update_1full_1resolution_1status(JNIEnv *env, jclass clz, int64_t this_arg, int64_t logger) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -48208,8 +50185,9 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1is_1fully_ void* logger_ptr = untag_ptr(logger); if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - jboolean ret_conv = ChannelMonitor_is_fully_resolved(&this_arg_conv, logger_conv); - return ret_conv; + LDKC2Tuple_boolboolZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_boolboolZ), "LDKC2Tuple_boolboolZ"); + *ret_conv = ChannelMonitor_check_and_update_full_resolution_status(&this_arg_conv, logger_conv); + return tag_ptr(ret_conv, true); } JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1claimable_1balances(JNIEnv *env, jclass clz, int64_t this_arg) { @@ -48543,7 +50521,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InboundHTLCErr_1eq(JNIEnv return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_peel_1payment_1onion(JNIEnv *env, jclass clz, int64_t msg, int64_t node_signer, int64_t logger, int32_t cur_height, jboolean accept_mpp_keysend, jboolean allow_skimmed_fees) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_peel_1payment_1onion(JNIEnv *env, jclass clz, int64_t msg, int64_t node_signer, int64_t logger, int32_t cur_height, jboolean allow_skimmed_fees) { LDKUpdateAddHTLC msg_conv; msg_conv.inner = untag_ptr(msg); msg_conv.is_owned = ptr_is_owned(msg); @@ -48564,7 +50542,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_peel_1payment_1onion(JNIEnv 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); + *ret_conv = peel_payment_onion(&msg_conv, node_signer_conv, logger_conv, cur_height, allow_skimmed_fees); return tag_ptr(ret_conv, true); } @@ -48653,7 +50631,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PendingHTLCRouting_1receive return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PendingHTLCRouting_1receive_1keysend(JNIEnv *env, jclass clz, int64_t payment_data, int8_tArray payment_preimage, int64_t payment_metadata, int32_t incoming_cltv_expiry, int64_tArray custom_tlvs, jboolean requires_blinded_error) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PendingHTLCRouting_1receive_1keysend(JNIEnv *env, jclass clz, int64_t payment_data, int8_tArray payment_preimage, int64_t payment_metadata, int32_t incoming_cltv_expiry, int64_tArray custom_tlvs, jboolean requires_blinded_error, jboolean has_recipient_created_payment_secret) { LDKFinalOnionHopData payment_data_conv; payment_data_conv.inner = untag_ptr(payment_data); payment_data_conv.is_owned = ptr_is_owned(payment_data); @@ -48683,7 +50661,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PendingHTLCRouting_1receive } (*env)->ReleaseLongArrayElements(env, custom_tlvs, custom_tlvs_vals, 0); LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCRouting_receive_keysend(payment_data_conv, payment_preimage_ref, payment_metadata_conv, incoming_cltv_expiry, custom_tlvs_constr, requires_blinded_error); + *ret_copy = PendingHTLCRouting_receive_keysend(payment_data_conv, payment_preimage_ref, payment_metadata_conv, incoming_cltv_expiry, custom_tlvs_constr, requires_blinded_error, has_recipient_created_payment_secret); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -49084,6 +51062,26 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedFailure_1eq(JNIEnv return ret_conv; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Verification_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); + LDKVerification this_ptr_conv = *(LDKVerification*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Verification_free(this_ptr_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1as_1Verification(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKUnauthenticatedReceiveTlvs this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKVerification* ret_ret = MALLOC(sizeof(LDKVerification), "LDKVerification"); + *ret_ret = UnauthenticatedReceiveTlvs_as_Verification(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FailureCode_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -49487,7 +51485,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone(JN return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv *env, jclass clz, int64_t fee_est, int64_t chain_monitor, int64_t tx_broadcaster, int64_t router, int64_t logger, int64_t entropy_source, int64_t node_signer, int64_t signer_provider, int64_t config, int64_t params, int32_t current_timestamp) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv *env, jclass clz, int64_t fee_est, int64_t chain_monitor, int64_t tx_broadcaster, int64_t router, int64_t message_router, int64_t logger, int64_t entropy_source, int64_t node_signer, int64_t signer_provider, int64_t config, int64_t params, int32_t current_timestamp) { void* fee_est_ptr = untag_ptr(fee_est); CHECK_ACCESS(fee_est_ptr); LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr); @@ -49516,6 +51514,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKRouter_JCalls_cloned(&router_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* logger_ptr = untag_ptr(logger); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -49554,7 +51559,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv params_conv.is_owned = ptr_is_owned(params); CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); params_conv = ChainParameters_clone(¶ms_conv); - LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, entropy_source_conv, node_signer_conv, signer_provider_conv, config_conv, params_conv, current_timestamp); + LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, message_router_conv, logger_conv, entropy_source_conv, node_signer_conv, signer_provider_conv, config_conv, params_conv, current_timestamp); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -49798,33 +51803,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1 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) { - 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; - LDKRoute route_conv; - route_conv.inner = untag_ptr(route); - route_conv.is_owned = ptr_is_owned(route); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - 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); - 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 = RecipientOnionFields_clone(&recipient_onion_conv); - LDKThirtyTwoBytes payment_id_ref; - 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); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t recipient_onion, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -49856,47 +51834,39 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payme return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1abandon_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment_1for_1bolt12_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice, int64_t context) { 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; - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref); + 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; + 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)); + LDKCResult_NoneBolt12PaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12PaymentErrorZ), "LDKCResult_NoneBolt12PaymentErrorZ"); + *ret_conv = ChannelManager_send_payment_for_bolt12_invoice(&this_arg_conv, &invoice_conv, context_conv); + return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int64_t payment_preimage, int64_t recipient_onion, int8_tArray payment_id) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1abandon_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id) { 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; - LDKRoute route_conv; - 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; - 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)); - 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 = RecipientOnionFields_clone(&recipient_onion_conv); LDKThirtyTwoBytes payment_id_ref; CHECK((*env)->GetArrayLength(env, payment_id) == 32); (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKCResult_ThirtyTwoBytesPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ), "LDKCResult_ThirtyTwoBytesPaymentSendFailureZ"); - *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_conv, recipient_onion_conv, payment_id_ref); - return tag_ptr(ret_conv, true); + ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment_1with_1retry(JNIEnv *env, jclass clz, int64_t this_arg, int64_t payment_preimage, int64_t recipient_onion, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t payment_preimage, int64_t recipient_onion, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -49924,7 +51894,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spont LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); LDKCResult_ThirtyTwoBytesRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesRetryableSendFailureZ), "LDKCResult_ThirtyTwoBytesRetryableSendFailureZ"); - *ret_conv = ChannelManager_send_spontaneous_payment_with_retry(&this_arg_conv, payment_preimage_conv, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv); + *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, payment_preimage_conv, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv); return tag_ptr(ret_conv, true); } @@ -49939,7 +51909,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1probe path_conv.is_owned = ptr_is_owned(path); CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); path_conv = Path_clone(&path_conv); - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ"); + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ"); *ret_conv = ChannelManager_send_probe(&this_arg_conv, path_conv); return tag_ptr(ret_conv, true); } @@ -50297,6 +52267,205 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inb return tag_ptr(ret_conv, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1signer_1unblocked(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_opt) { + 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* channel_opt_ptr = untag_ptr(channel_opt); + CHECK_ACCESS(channel_opt_ptr); + LDKCOption_C2Tuple_PublicKeyChannelIdZZ channel_opt_conv = *(LDKCOption_C2Tuple_PublicKeyChannelIdZZ*)(channel_opt_ptr); + channel_opt_conv = COption_C2Tuple_PublicKeyChannelIdZZ_clone((LDKCOption_C2Tuple_PublicKeyChannelIdZZ*)untag_ptr(channel_opt)); + ChannelManager_signer_unblocked(&this_arg_conv, channel_opt_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1bolt11_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int64_t params) { + 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; + LDKBolt11InvoiceParameters params_conv; + params_conv.inner = untag_ptr(params); + params_conv.is_owned = ptr_is_owned(params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); + // WARNING: we need a move here but no clone is available for LDKBolt11InvoiceParameters + + LDKCResult_Bolt11InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceSignOrCreationErrorZ), "LDKCResult_Bolt11InvoiceSignOrCreationErrorZ"); + *ret_conv = ChannelManager_create_bolt11_invoice(&this_arg_conv, params_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBolt11InvoiceParameters this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt11InvoiceParameters_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1get_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = Bolt11InvoiceParameters_get_amount_msats(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1set_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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)); + Bolt11InvoiceParameters_set_amount_msats(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1get_1description(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBolt11InvoiceDescription *ret_copy = MALLOC(sizeof(LDKBolt11InvoiceDescription), "LDKBolt11InvoiceDescription"); + *ret_copy = Bolt11InvoiceParameters_get_description(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1set_1description(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + LDKBolt11InvoiceDescription val_conv = *(LDKBolt11InvoiceDescription*)(val_ptr); + val_conv = Bolt11InvoiceDescription_clone((LDKBolt11InvoiceDescription*)untag_ptr(val)); + Bolt11InvoiceParameters_set_description(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1get_1invoice_1expiry_1delta_1secs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = Bolt11InvoiceParameters_get_invoice_expiry_delta_secs(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1set_1invoice_1expiry_1delta_1secs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); + Bolt11InvoiceParameters_set_invoice_expiry_delta_secs(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1get_1min_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = Bolt11InvoiceParameters_get_min_final_cltv_expiry_delta(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1set_1min_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); + val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val)); + Bolt11InvoiceParameters_set_min_final_cltv_expiry_delta(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = Bolt11InvoiceParameters_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_Bolt11InvoiceParameters_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBolt11InvoiceParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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)); + Bolt11InvoiceParameters_set_payment_hash(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1new(JNIEnv *env, jclass clz, int64_t amount_msats_arg, int64_t description_arg, int64_t invoice_expiry_delta_secs_arg, int64_t min_final_cltv_expiry_delta_arg, int64_t payment_hash_arg) { + void* amount_msats_arg_ptr = untag_ptr(amount_msats_arg); + CHECK_ACCESS(amount_msats_arg_ptr); + LDKCOption_u64Z amount_msats_arg_conv = *(LDKCOption_u64Z*)(amount_msats_arg_ptr); + amount_msats_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amount_msats_arg)); + void* description_arg_ptr = untag_ptr(description_arg); + CHECK_ACCESS(description_arg_ptr); + LDKBolt11InvoiceDescription description_arg_conv = *(LDKBolt11InvoiceDescription*)(description_arg_ptr); + description_arg_conv = Bolt11InvoiceDescription_clone((LDKBolt11InvoiceDescription*)untag_ptr(description_arg)); + void* invoice_expiry_delta_secs_arg_ptr = untag_ptr(invoice_expiry_delta_secs_arg); + CHECK_ACCESS(invoice_expiry_delta_secs_arg_ptr); + LDKCOption_u32Z invoice_expiry_delta_secs_arg_conv = *(LDKCOption_u32Z*)(invoice_expiry_delta_secs_arg_ptr); + invoice_expiry_delta_secs_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(invoice_expiry_delta_secs_arg)); + void* min_final_cltv_expiry_delta_arg_ptr = untag_ptr(min_final_cltv_expiry_delta_arg); + CHECK_ACCESS(min_final_cltv_expiry_delta_arg_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_arg_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_arg_ptr); + min_final_cltv_expiry_delta_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta_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)); + LDKBolt11InvoiceParameters ret_var = Bolt11InvoiceParameters_new(amount_msats_arg_conv, description_arg_conv, invoice_expiry_delta_secs_arg_conv, min_final_cltv_expiry_delta_arg_conv, 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); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1default(JNIEnv *env, jclass clz) { + LDKBolt11InvoiceParameters ret_var = Bolt11InvoiceParameters_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_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); @@ -50389,6 +52558,49 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1request_1re return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1pay_1for_1offer_1from_1human_1readable_1name(JNIEnv *env, jclass clz, int64_t this_arg, int64_t name, int64_t amount_msats, int8_tArray payment_id, int64_t retry_strategy, int64_t max_total_routing_fee_msat, int64_tArray dns_resolvers) { + 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; + LDKHumanReadableName name_conv; + name_conv.inner = untag_ptr(name); + name_conv.is_owned = ptr_is_owned(name); + CHECK_INNER_FIELD_ACCESS_OR_NULL(name_conv); + name_conv = HumanReadableName_clone(&name_conv); + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + void* retry_strategy_ptr = untag_ptr(retry_strategy); + CHECK_ACCESS(retry_strategy_ptr); + LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); + retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); + void* max_total_routing_fee_msat_ptr = untag_ptr(max_total_routing_fee_msat); + CHECK_ACCESS(max_total_routing_fee_msat_ptr); + LDKCOption_u64Z max_total_routing_fee_msat_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_ptr); + max_total_routing_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat)); + LDKCVec_DestinationZ dns_resolvers_constr; + dns_resolvers_constr.datalen = (*env)->GetArrayLength(env, dns_resolvers); + if (dns_resolvers_constr.datalen > 0) + dns_resolvers_constr.data = MALLOC(dns_resolvers_constr.datalen * sizeof(LDKDestination), "LDKCVec_DestinationZ Elements"); + else + dns_resolvers_constr.data = NULL; + int64_t* dns_resolvers_vals = (*env)->GetLongArrayElements (env, dns_resolvers, NULL); + for (size_t n = 0; n < dns_resolvers_constr.datalen; n++) { + int64_t dns_resolvers_conv_13 = dns_resolvers_vals[n]; + void* dns_resolvers_conv_13_ptr = untag_ptr(dns_resolvers_conv_13); + CHECK_ACCESS(dns_resolvers_conv_13_ptr); + LDKDestination dns_resolvers_conv_13_conv = *(LDKDestination*)(dns_resolvers_conv_13_ptr); + dns_resolvers_conv_13_conv = Destination_clone((LDKDestination*)untag_ptr(dns_resolvers_conv_13)); + dns_resolvers_constr.data[n] = dns_resolvers_conv_13_conv; + } + (*env)->ReleaseLongArrayElements(env, dns_resolvers, dns_resolvers_vals, 0); + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelManager_pay_for_offer_from_human_readable_name(&this_arg_conv, name_conv, amount_msats, payment_id_ref, retry_strategy_conv, max_total_routing_fee_msat_conv, dns_resolvers_constr); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t min_final_cltv_expiry_delta) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -50658,6 +52870,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1AsyncPa return tag_ptr(ret_ret, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1DNSResolverMessageHandler(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; + LDKDNSResolverMessageHandler* ret_ret = MALLOC(sizeof(LDKDNSResolverMessageHandler), "LDKDNSResolverMessageHandler"); + *ret_ret = ChannelManager_as_DNSResolverMessageHandler(&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); @@ -50999,6 +53222,33 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1r ChannelManagerReadArgs_set_router(&this_ptr_conv, val_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1message_1router(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_message_router(&this_ptr_conv), false); + return ret_ret; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1message_1router(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + LDKMessageRouter val_conv = *(LDKMessageRouter*)(val_ptr); + if (val_conv.free == LDKMessageRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKMessageRouter_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_message_router(&this_ptr_conv, val_conv); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -51053,7 +53303,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1d ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t signer_provider, int64_t fee_estimator, int64_t chain_monitor, int64_t tx_broadcaster, int64_t router, int64_t logger, int64_t default_config, int64_tArray channel_monitors) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new(JNIEnv *env, jclass clz, int64_t entropy_source, int64_t node_signer, int64_t signer_provider, int64_t fee_estimator, int64_t chain_monitor, int64_t tx_broadcaster, int64_t router, int64_t message_router, int64_t logger, int64_t default_config, int64_tArray channel_monitors) { void* entropy_source_ptr = untag_ptr(entropy_source); CHECK_ACCESS(entropy_source_ptr); LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); @@ -51103,6 +53353,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKRouter_JCalls_cloned(&router_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* logger_ptr = untag_ptr(logger); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -51132,7 +53389,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, channel_monitors, channel_monitors_vals, 0); - LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(entropy_source_conv, node_signer_conv, signer_provider_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, default_config_conv, channel_monitors_constr); + LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(entropy_source_conv, node_signer_conv, signer_provider_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, message_router_conv, logger_conv, default_config_conv, channel_monitors_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); @@ -53208,25 +55465,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1feerate_1 ChannelDetails_set_feerate_sat_per_1000_weight(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1balance_1msat(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; - int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1balance_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t 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_balance_msat(&this_ptr_conv, val); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -53652,7 +55890,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_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) { +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 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); @@ -53759,7 +55997,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_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); + 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, 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); @@ -53908,11 +56146,65 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1free(JNIEnv *env, ExpandedKey_free(this_obj_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKExpandedKey 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 = ExpandedKey_hash(&o_conv); + return ret_conv; +} + +static inline uint64_t ExpandedKey_clone_ptr(LDKExpandedKey *NONNULL_PTR arg) { + LDKExpandedKey ret_var = ExpandedKey_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_ExpandedKey_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKExpandedKey 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 = ExpandedKey_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKExpandedKey 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; + LDKExpandedKey ret_var = ExpandedKey_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_ExpandedKey_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKExpandedKey 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; + LDKExpandedKey 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 = ExpandedKey_eq(&a_conv, &b_conv); + return ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1new(JNIEnv *env, jclass clz, int8_tArray key_material) { - uint8_t key_material_arr[32]; + LDKThirtyTwoBytes key_material_ref; CHECK((*env)->GetArrayLength(env, key_material) == 32); - (*env)->GetByteArrayRegion(env, key_material, 0, 32, key_material_arr); - uint8_t (*key_material_ref)[32] = &key_material_arr; + (*env)->GetByteArrayRegion(env, key_material, 0, 32, key_material_ref.data); LDKExpandedKey ret_var = ExpandedKey_new(key_material_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); @@ -64197,6 +66489,21 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FinalOnionHopData_1clone(JN return ret_ref; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_FinalOnionHopData_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKFinalOnionHopData 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; + LDKFinalOnionHopData 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 = FinalOnionHopData_eq(&a_conv, &b_conv); + return ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionPacket_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKOnionPacket this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -65805,6 +68112,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_1DNSResolverMessageHandler(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; + LDKDNSResolverMessageHandler* ret_ret = MALLOC(sizeof(LDKDNSResolverMessageHandler), "LDKDNSResolverMessageHandler"); + *ret_ret = IgnoringMessageHandler_as_DNSResolverMessageHandler(&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); @@ -68961,167 +71279,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1commitment_1transactio 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 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 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 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 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_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 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 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 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_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); @@ -69575,18 +71732,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelId_1read(JNIEnv *env 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 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); @@ -69707,27 +71852,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1w 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) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, 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); @@ -69738,31 +71868,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan 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); + *ret_conv = create_invoice_from_channelmanager(&channelmanager_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) { +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 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); @@ -69777,31 +71892,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan 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); + *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_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) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash_1and_1payment_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t amt_msat, int64_t description_hash, 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); @@ -69811,71 +71911,24 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan 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); + 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_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); + *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_payment_hash(&channelmanager_conv, amt_msat_conv, description_hash_conv, 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_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) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1payment_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t amt_msat, jstring description, 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); @@ -69889,18 +71942,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan 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); + *ret_conv = create_invoice_from_channelmanager_with_payment_hash(&channelmanager_conv, amt_msat_conv, description_conv, 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_payment_1parameters_1from_1zero_1amount_1invoice(JNIEnv *env, jclass clz, int64_t invoice, int64_t amount_msat) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_payment_1parameters_1from_1variable_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); + *ret_conv = payment_parameters_from_variable_amount_invoice(&invoice_conv, amount_msat); return tag_ptr(ret_conv, true); } @@ -70023,137 +72076,6 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1eq(J 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); -} - -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 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 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_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_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_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 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_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 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); @@ -70255,13 +72177,20 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1route_1no return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1sending_1failed(JNIEnv *env, jclass clz, int64_t a) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1parameter_1error(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)); + LDKAPIError a_conv = *(LDKAPIError*)(a_ptr); + a_conv = APIError_clone((LDKAPIError*)untag_ptr(a)); LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); - *ret_copy = ProbeSendFailure_sending_failed(a_conv); + *ret_copy = ProbeSendFailure_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_ProbeSendFailure_1duplicate_1probe(JNIEnv *env, jclass clz) { + LDKProbeSendFailure *ret_copy = MALLOC(sizeof(LDKProbeSendFailure), "LDKProbeSendFailure"); + *ret_copy = ProbeSendFailure_duplicate_probe(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -70505,6 +72434,167 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Type_1free(JNIEnv *env, jclass Type_free(this_ptr_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 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 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 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 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_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 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 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 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_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_OfferId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKOfferId this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -71077,14 +73167,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1supported_1quantity( return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1issuer_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); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Offer_issuer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -71154,7 +73244,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1expects_1quantity(J return ret_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) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice(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); @@ -71173,53 +73263,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice_1de 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 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; - 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 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); + LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = Offer_request_invoice(&this_arg_conv, &expanded_key_conv, nonce_conv, payment_id_ref); return tag_ptr(ret_conv, true); } @@ -71631,6 +73676,28 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1clone(JNIEnv return ret_ref; } +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payment_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_BlindedPaymentPathZ ret_var = UnsignedBolt12Invoice_payment_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++) { + 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; +} + 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); @@ -71839,6 +73906,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1supp return ret_ref; } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1issuer_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_issuer_signing_pubkey(&this_arg_conv).compressed_form); + return ret_arr; +} + 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); @@ -71876,14 +73954,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1quan return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_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_payer_id(&this_arg_conv).compressed_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedBolt12Invoice_payer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -71921,6 +73999,28 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1amou return ret_conv; } +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payment_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; + LDKCVec_BlindedPaymentPathZ ret_var = Bolt12Invoice_payment_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++) { + 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; +} + 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); @@ -72129,6 +74229,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1supported_1q return ret_ref; } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1issuer_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_issuer_signing_pubkey(&this_arg_conv).compressed_form); + return ret_arr; +} + 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); @@ -72166,14 +74277,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1quantity(JNI return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_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_payer_id(&this_arg_conv).compressed_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Bolt12Invoice_payer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -72567,140 +74678,87 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceError_1read(JNIEnv * 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; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_obj_conv; this_obj_conv.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); + InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_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; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1build_1and_1sign(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_arg_conv; this_arg_conv.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 + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder - LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_build(this_arg_conv); + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_build_and_sign(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; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1chain(JNIEnv *env, jclass clz, int64_t this_arg, jclass network) { + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_arg_conv; this_arg_conv.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 + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder 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); + *ret_conv = InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_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; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg, int64_t amount_msats) { + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_arg_conv; this_arg_conv.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 + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(this_arg_conv, amount_msats); + *ret_conv = InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_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; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) { + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_arg_conv; this_arg_conv.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 + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_quantity(this_arg_conv, quantity); + *ret_conv = InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_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; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg, jstring payer_note) { + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_arg_conv; this_arg_conv.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 + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder LDKStr payer_note_conv = java_to_owned_str(env, payer_note); - InvoiceRequestWithExplicitPayerIdBuilder_payer_note(this_arg_conv, payer_note_conv); + InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_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; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1sourced_1from_1human_1readable_1name(JNIEnv *env, jclass clz, int64_t this_arg, int64_t hrn) { + LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder this_arg_conv; this_arg_conv.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 + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerSigningPubkeyBuilder - 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); + LDKHumanReadableName hrn_conv; + hrn_conv.inner = untag_ptr(hrn); + hrn_conv.is_owned = ptr_is_owned(hrn); + CHECK_INNER_FIELD_ACCESS_OR_NULL(hrn_conv); + hrn_conv = HumanReadableName_clone(&hrn_conv); + InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_sourced_from_human_readable_name(this_arg_conv, hrn_conv); } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1free(JNIEnv *env, jclass clz, int64_t this_obj) { @@ -72995,14 +75053,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1sup return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1issuer_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; int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedInvoiceRequest_signing_pubkey(&this_arg_conv).compressed_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedInvoiceRequest_issuer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -73041,6 +75099,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1amo return ret_ref; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1has_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 = UnsignedInvoiceRequest_has_amount_msats(&this_arg_conv); + return ret_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); @@ -73066,14 +75134,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1qua return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_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; int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedInvoiceRequest_payer_id(&this_arg_conv).compressed_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedInvoiceRequest_payer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -73090,6 +75158,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1pay return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1offer_1from_1hrn(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; + LDKHumanReadableName ret_var = UnsignedInvoiceRequest_offer_from_hrn(&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 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); @@ -73219,14 +75300,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1supported_1 return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1issuer_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); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, InvoiceRequest_issuer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -73265,6 +75346,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1amount_1msa return ret_ref; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1has_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 = InvoiceRequest_has_amount_msats(&this_arg_conv); + return ret_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); @@ -73290,14 +75381,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1quantity(JN return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_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_payer_id(&this_arg_conv).compressed_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, InvoiceRequest_payer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -73314,6 +75405,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1note return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1offer_1from_1hrn(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; + LDKHumanReadableName ret_var = InvoiceRequest_offer_from_hrn(&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_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); @@ -73553,14 +75657,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1sup return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1issuer_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); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, VerifiedInvoiceRequest_issuer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -73599,6 +75703,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1amo return ret_ref; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1has_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; + jboolean ret_conv = VerifiedInvoiceRequest_has_amount_msats(&this_arg_conv); + return ret_conv; +} + 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); @@ -73624,14 +75738,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1qua return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_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_payer_id(&this_arg_conv).compressed_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, VerifiedInvoiceRequest_payer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -73648,6 +75762,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1pay return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1offer_1from_1hrn(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; + LDKHumanReadableName ret_var = VerifiedInvoiceRequest_offer_from_hrn(&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); @@ -73798,6 +75925,16 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1write(J return ret_arr; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_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_InvoiceRequestDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestDecodeErrorZ), "LDKCResult_InvoiceRequestDecodeErrorZ"); + *ret_conv = InvoiceRequest_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; this_obj_conv.inner = untag_ptr(this_obj); @@ -73806,18 +75943,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1free(JNI InvoiceRequestFields_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) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1payer_1signing_1pubkey(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; 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, InvoiceRequestFields_get_payer_signing_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) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1payer_1signing_1pubkey(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); @@ -73826,7 +75963,7 @@ 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); + InvoiceRequestFields_set_payer_signing_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) { @@ -73881,10 +76018,37 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1pay 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); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1human_1readable_1name(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; + LDKHumanReadableName ret_var = InvoiceRequestFields_get_human_readable_name(&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_1human_1readable_1name(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; + LDKHumanReadableName 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 = HumanReadableName_clone(&val_conv); + InvoiceRequestFields_set_human_readable_name(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1new(JNIEnv *env, jclass clz, int8_tArray payer_signing_pubkey_arg, int64_t quantity_arg, int64_t payer_note_truncated_arg, int64_t human_readable_name_arg) { + LDKPublicKey payer_signing_pubkey_arg_ref; + CHECK((*env)->GetArrayLength(env, payer_signing_pubkey_arg) == 33); + (*env)->GetByteArrayRegion(env, payer_signing_pubkey_arg, 0, 33, payer_signing_pubkey_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); @@ -73894,7 +76058,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1new(J 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); + LDKHumanReadableName human_readable_name_arg_conv; + human_readable_name_arg_conv.inner = untag_ptr(human_readable_name_arg); + human_readable_name_arg_conv.is_owned = ptr_is_owned(human_readable_name_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(human_readable_name_arg_conv); + human_readable_name_arg_conv = HumanReadableName_clone(&human_readable_name_arg_conv); + LDKInvoiceRequestFields ret_var = InvoiceRequestFields_new(payer_signing_pubkey_arg_ref, quantity_arg_conv, payer_note_truncated_arg_conv, human_readable_name_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); @@ -74287,18 +76456,13 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing return ret_conv; } -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()); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1issuer_1signing_1pubkey(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_issuer_signing_pubkey()); return ret_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 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()); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1issuer_1signing_1pubkey(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_issuer_signing_pubkey()); return ret_conv; } @@ -74332,8 +76496,8 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing return ret_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()); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payer_1signing_1pubkey(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_missing_payer_signing_pubkey()); return ret_conv; } @@ -74372,11 +76536,26 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpec return ret_conv; } +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 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 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 jclass JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1human_1readable_1name(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKBolt12SemanticError_to_java(env, Bolt12SemanticError_unexpected_human_readable_name()); + return ret_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); @@ -74415,20 +76594,20 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetad 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) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1new(JNIEnv *env, jclass clz, int8_tArray metadata, int8_tArray signing_pubkey, 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); + LDKPublicKey signing_pubkey_ref; + CHECK((*env)->GetArrayLength(env, signing_pubkey) == 33); + (*env)->GetByteArrayRegion(env, signing_pubkey, 0, 33, signing_pubkey_ref.compressed_form); LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); - *ret_conv = RefundMaybeWithDerivedMetadataBuilder_new(metadata_ref, payer_id_ref, amount_msats); + *ret_conv = RefundMaybeWithDerivedMetadataBuilder_new(metadata_ref, signing_pubkey_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 nonce, int64_t amount_msats, int8_tArray payment_id) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1deriving_1signing_1pubkey(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); @@ -74446,7 +76625,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetad 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); + *ret_conv = RefundMaybeWithDerivedMetadataBuilder_deriving_signing_pubkey(node_id_ref, &expanded_key_conv, nonce_conv, amount_msats, payment_id_ref); return tag_ptr(ret_conv, true); } @@ -74709,14 +76888,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1quantity(JNIEnv *en return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1signing_1pubkey(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); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Refund_payer_signing_pubkey(&this_arg_conv).compressed_form); return ret_arr; } @@ -77157,17 +79336,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router(J return tag_ptr(ret_ret, true); } -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 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); @@ -80275,7 +82443,29 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1histor 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) { +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, jboolean allow_fallback_estimation) { + 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, allow_fallback_estimation); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1live_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); @@ -80292,7 +82482,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1histor 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); + *ret_copy = ProbabilisticScorer_live_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; } @@ -82460,34 +84650,8 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1free(JNIEnv HeldHtlcAvailable_free(this_obj_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; - 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_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; - 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_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); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1new(JNIEnv *env, jclass clz) { + LDKHeldHtlcAvailable ret_var = HeldHtlcAvailable_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); @@ -82532,34 +84696,8 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1free(JNIEnv * 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; - 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 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); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1new(JNIEnv *env, jclass clz) { + LDKReleaseHeldHtlc ret_var = ReleaseHeldHtlc_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); @@ -82684,6 +84822,480 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1read( return tag_ptr(ret_conv, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DNSResolverMessageHandler_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); + LDKDNSResolverMessageHandler this_ptr_conv = *(LDKDNSResolverMessageHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + DNSResolverMessageHandler_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_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); + LDKDNSResolverMessage this_ptr_conv = *(LDKDNSResolverMessage*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + DNSResolverMessage_free(this_ptr_conv); +} + +static inline uint64_t DNSResolverMessage_clone_ptr(LDKDNSResolverMessage *NONNULL_PTR arg) { + LDKDNSResolverMessage *ret_copy = MALLOC(sizeof(LDKDNSResolverMessage), "LDKDNSResolverMessage"); + *ret_copy = DNSResolverMessage_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDNSResolverMessage* arg_conv = (LDKDNSResolverMessage*)untag_ptr(arg); + int64_t ret_conv = DNSResolverMessage_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDNSResolverMessage* orig_conv = (LDKDNSResolverMessage*)untag_ptr(orig); + LDKDNSResolverMessage *ret_copy = MALLOC(sizeof(LDKDNSResolverMessage), "LDKDNSResolverMessage"); + *ret_copy = DNSResolverMessage_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1dnssecquery(JNIEnv *env, jclass clz, int64_t a) { + LDKDNSSECQuery 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 = DNSSECQuery_clone(&a_conv); + LDKDNSResolverMessage *ret_copy = MALLOC(sizeof(LDKDNSResolverMessage), "LDKDNSResolverMessage"); + *ret_copy = DNSResolverMessage_dnssecquery(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1dnssecproof(JNIEnv *env, jclass clz, int64_t a) { + LDKDNSSECProof 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 = DNSSECProof_clone(&a_conv); + LDKDNSResolverMessage *ret_copy = MALLOC(sizeof(LDKDNSResolverMessage), "LDKDNSResolverMessage"); + *ret_copy = DNSResolverMessage_dnssecproof(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKDNSResolverMessage* o_conv = (LDKDNSResolverMessage*)untag_ptr(o); + int64_t ret_conv = DNSResolverMessage_hash(o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKDNSResolverMessage* a_conv = (LDKDNSResolverMessage*)untag_ptr(a); + LDKDNSResolverMessage* b_conv = (LDKDNSResolverMessage*)untag_ptr(b); + jboolean ret_conv = DNSResolverMessage_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DNSSECQuery_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDNSSECQuery this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DNSSECQuery_free(this_obj_conv); +} + +static inline uint64_t DNSSECQuery_clone_ptr(LDKDNSSECQuery *NONNULL_PTR arg) { + LDKDNSSECQuery ret_var = DNSSECQuery_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_DNSSECQuery_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDNSSECQuery 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 = DNSSECQuery_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSSECQuery_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDNSSECQuery 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; + LDKDNSSECQuery ret_var = DNSSECQuery_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_DNSSECQuery_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKDNSSECQuery 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 = DNSSECQuery_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DNSSECQuery_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKDNSSECQuery 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; + LDKDNSSECQuery 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 = DNSSECQuery_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DNSSECProof_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDNSSECProof this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DNSSECProof_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DNSSECProof_1get_1proof(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDNSSECProof this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = DNSSECProof_get_proof(&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_DNSSECProof_1set_1proof(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKDNSSECProof this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + DNSSECProof_set_proof(&this_ptr_conv, val_ref); +} + +static inline uint64_t DNSSECProof_clone_ptr(LDKDNSSECProof *NONNULL_PTR arg) { + LDKDNSSECProof ret_var = DNSSECProof_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_DNSSECProof_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDNSSECProof 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 = DNSSECProof_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSSECProof_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDNSSECProof 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; + LDKDNSSECProof ret_var = DNSSECProof_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_DNSSECProof_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKDNSSECProof 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 = DNSSECProof_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DNSSECProof_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKDNSSECProof 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; + LDKDNSSECProof 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 = DNSSECProof_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1is_1known_1type(JNIEnv *env, jclass clz, int64_t tlv_type) { + jboolean ret_conv = DNSResolverMessage_is_known_type(tlv_type); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKDNSResolverMessage* obj_conv = (LDKDNSResolverMessage*)untag_ptr(obj); + LDKCVec_u8Z ret_var = DNSResolverMessage_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_DNSResolverMessage_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_DNSResolverMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverMessageDecodeErrorZ), "LDKCResult_DNSResolverMessageDecodeErrorZ"); + *ret_conv = DNSResolverMessage_read(ser_ref, arg); + (*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_DNSResolverMessage_1as_1OnionMessageContents(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDNSResolverMessage* this_arg_conv = (LDKDNSResolverMessage*)untag_ptr(this_arg); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = DNSResolverMessage_as_OnionMessageContents(this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKHumanReadableName this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + HumanReadableName_free(this_obj_conv); +} + +static inline uint64_t HumanReadableName_clone_ptr(LDKHumanReadableName *NONNULL_PTR arg) { + LDKHumanReadableName ret_var = HumanReadableName_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_HumanReadableName_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHumanReadableName 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 = HumanReadableName_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKHumanReadableName 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; + LDKHumanReadableName ret_var = HumanReadableName_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_HumanReadableName_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKHumanReadableName 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 = HumanReadableName_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKHumanReadableName 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; + LDKHumanReadableName 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 = HumanReadableName_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1new(JNIEnv *env, jclass clz, jstring user, jstring domain) { + LDKStr user_conv = java_to_owned_str(env, user); + LDKStr domain_conv = java_to_owned_str(env, domain); + LDKCResult_HumanReadableNameNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameNoneZ), "LDKCResult_HumanReadableNameNoneZ"); + *ret_conv = HumanReadableName_new(user_conv, domain_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1from_1encoded(JNIEnv *env, jclass clz, jstring encoded) { + LDKStr encoded_conv = java_to_owned_str(env, encoded); + LDKCResult_HumanReadableNameNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameNoneZ), "LDKCResult_HumanReadableNameNoneZ"); + *ret_conv = HumanReadableName_from_encoded(encoded_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1user(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKHumanReadableName this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = HumanReadableName_user(&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 jstring JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1domain(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKHumanReadableName this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = HumanReadableName_domain(&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 int8_tArray JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKHumanReadableName 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 = HumanReadableName_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_HumanReadableName_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_HumanReadableNameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HumanReadableNameDecodeErrorZ), "LDKCResult_HumanReadableNameDecodeErrorZ"); + *ret_conv = HumanReadableName_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_OMNameResolver_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOMNameResolver this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OMNameResolver_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OMNameResolver_1new(JNIEnv *env, jclass clz, int32_t latest_block_time, int32_t latest_block_height) { + LDKOMNameResolver ret_var = OMNameResolver_new(latest_block_time, latest_block_height); + int64_t ret_ref = 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_OMNameResolver_1new_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg, int32_t height, int32_t time) { + LDKOMNameResolver this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + OMNameResolver_new_best_block(&this_arg_conv, height, time); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OMNameResolver_1resolve_1name(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id, int64_t name, int64_t entropy_source) { + LDKOMNameResolver this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKHumanReadableName name_conv; + name_conv.inner = untag_ptr(name); + name_conv.is_owned = ptr_is_owned(name); + CHECK_INNER_FIELD_ACCESS_OR_NULL(name_conv); + name_conv = HumanReadableName_clone(&name_conv); + 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; + LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ), "LDKCResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ"); + *ret_conv = OMNameResolver_resolve_name(&this_arg_conv, payment_id_ref, name_conv, entropy_source_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OMNameResolver_1handle_1dnssec_1proof_1for_1offer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg, int64_t context) { + LDKOMNameResolver this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKDNSSECProof 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 = DNSSECProof_clone(&msg_conv); + LDKDNSResolverContext context_conv; + context_conv.inner = untag_ptr(context); + context_conv.is_owned = ptr_is_owned(context); + CHECK_INNER_FIELD_ACCESS_OR_NULL(context_conv); + context_conv = DNSResolverContext_clone(&context_conv); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ"); + *ret_copy = OMNameResolver_handle_dnssec_proof_for_offer(&this_arg_conv, msg_conv, context_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OMNameResolver_1handle_1dnssec_1proof_1for_1uri(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg, int64_t context) { + LDKOMNameResolver this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKDNSSECProof 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 = DNSSECProof_clone(&msg_conv); + LDKDNSResolverContext context_conv; + context_conv.inner = untag_ptr(context); + context_conv.is_owned = ptr_is_owned(context); + CHECK_INNER_FIELD_ACCESS_OR_NULL(context_conv); + context_conv = DNSResolverContext_clone(&context_conv); + LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ), "LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ"); + *ret_copy = OMNameResolver_handle_dnssec_proof_for_uri(&this_arg_conv, msg_conv, context_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + 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); @@ -82836,6 +85448,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ResponseInstruction_1clone( return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ResponseInstruction_1into_1instructions(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKResponseInstruction this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = ResponseInstruction_clone(&this_arg_conv); + LDKMessageSendInstructions *ret_copy = MALLOC(sizeof(LDKMessageSendInstructions), "LDKMessageSendInstructions"); + *ret_copy = ResponseInstruction_into_instructions(this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + 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); @@ -83561,7 +86185,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_peel_1onion_1message(JNIEnv 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) { +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 dns_resolver, 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); @@ -83611,6 +86235,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new(JNIEnv // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKAsyncPaymentsMessageHandler_JCalls_cloned(&async_payments_handler_conv); } + void* dns_resolver_ptr = untag_ptr(dns_resolver); + CHECK_ACCESS(dns_resolver_ptr); + LDKDNSResolverMessageHandler dns_resolver_conv = *(LDKDNSResolverMessageHandler*)(dns_resolver_ptr); + if (dns_resolver_conv.free == LDKDNSResolverMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKDNSResolverMessageHandler_JCalls_cloned(&dns_resolver_conv); + } void* custom_handler_ptr = untag_ptr(custom_handler); CHECK_ACCESS(custom_handler_ptr); LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); @@ -83618,14 +86249,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new(JNIEnv // 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); + 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, dns_resolver_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) { +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 dns_resolver, 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); @@ -83675,6 +86306,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new_1with_1 // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKAsyncPaymentsMessageHandler_JCalls_cloned(&async_payments_handler_conv); } + void* dns_resolver_ptr = untag_ptr(dns_resolver); + CHECK_ACCESS(dns_resolver_ptr); + LDKDNSResolverMessageHandler dns_resolver_conv = *(LDKDNSResolverMessageHandler*)(dns_resolver_ptr); + if (dns_resolver_conv.free == LDKDNSResolverMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKDNSResolverMessageHandler_JCalls_cloned(&dns_resolver_conv); + } void* custom_handler_ptr = untag_ptr(custom_handler); CHECK_ACCESS(custom_handler_ptr); LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr); @@ -83682,7 +86320,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new_1with_1 // 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); + 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, dns_resolver_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); @@ -84121,6 +86759,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_ return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1dnsresolver(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKDNSResolverMessage a_conv = *(LDKDNSResolverMessage*)(a_ptr); + a_conv = DNSResolverMessage_clone((LDKDNSResolverMessage*)untag_ptr(a)); + LDKParsedOnionMessageContents *ret_copy = MALLOC(sizeof(LDKParsedOnionMessageContents), "LDKParsedOnionMessageContents"); + *ret_copy = ParsedOnionMessageContents_dnsresolver(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); @@ -85225,19 +87874,70 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1free(JNIEnv *env, ReceiveTlvs_free(this_obj_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; +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_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 = ReceiveTlvs_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; + 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); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_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_1tlvs(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKReceiveTlvs this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKUnauthenticatedReceiveTlvs ret_var = ReceiveTlvs_tlvs(&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_UnauthenticatedReceiveTlvs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUnauthenticatedReceiveTlvs this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + UnauthenticatedReceiveTlvs_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1get_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnauthenticatedReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnauthenticatedReceiveTlvs_get_payment_secret(&this_ptr_conv)); return ret_arr; } -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; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1set_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnauthenticatedReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -85245,24 +87945,24 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1sec 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); + UnauthenticatedReceiveTlvs_set_payment_secret(&this_ptr_conv, val_ref); } -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; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1get_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnauthenticatedReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); + LDKPaymentConstraints ret_var = UnauthenticatedReceiveTlvs_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; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1set_1payment_1constraints(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUnauthenticatedReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -85272,23 +87972,23 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1con 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); + UnauthenticatedReceiveTlvs_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; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1get_1payment_1context(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnauthenticatedReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); + *ret_copy = UnauthenticatedReceiveTlvs_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_ReceiveTlvs_1set_1payment_1context(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKReceiveTlvs this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1set_1payment_1context(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUnauthenticatedReceiveTlvs this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -85297,10 +87997,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1con 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); + UnauthenticatedReceiveTlvs_set_payment_context(&this_ptr_conv, val_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) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_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); @@ -85313,37 +88013,60 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1new(JNIEnv *en 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); + LDKUnauthenticatedReceiveTlvs ret_var = UnauthenticatedReceiveTlvs_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 ReceiveTlvs_clone_ptr(LDKReceiveTlvs *NONNULL_PTR arg) { - LDKReceiveTlvs ret_var = ReceiveTlvs_clone(arg); +static inline uint64_t UnauthenticatedReceiveTlvs_clone_ptr(LDKUnauthenticatedReceiveTlvs *NONNULL_PTR arg) { + LDKUnauthenticatedReceiveTlvs ret_var = UnauthenticatedReceiveTlvs_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_UnauthenticatedReceiveTlvs_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnauthenticatedReceiveTlvs 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 = UnauthenticatedReceiveTlvs_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_UnauthenticatedReceiveTlvs_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUnauthenticatedReceiveTlvs 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); + LDKUnauthenticatedReceiveTlvs ret_var = UnauthenticatedReceiveTlvs_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_UnauthenticatedReceiveTlvs_1authenticate(JNIEnv *env, jclass clz, int64_t this_arg, int64_t nonce, int64_t expanded_key) { + LDKUnauthenticatedReceiveTlvs this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = UnauthenticatedReceiveTlvs_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 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; + LDKReceiveTlvs ret_var = UnauthenticatedReceiveTlvs_authenticate(this_arg_conv, nonce_conv, &expanded_key_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -85566,18 +88289,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1clone(JNIEn 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); @@ -85609,59 +88320,6 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentContext_1eq(JNIEnv 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); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_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 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); @@ -85874,6 +88532,19 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1write(JNIE return ret_arr; } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUnauthenticatedReceiveTlvs 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 = UnauthenticatedReceiveTlvs_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_PaymentRelay_1write(JNIEnv *env, jclass clz, int64_t obj) { LDKPaymentRelay obj_conv; obj_conv.inner = untag_ptr(obj); @@ -85939,29 +88610,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentContext_1read(JNIEnv return tag_ptr(ret_conv, true); } -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 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 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); @@ -86470,6 +89118,29 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageContext_1offers(JNIE return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageContext_1async_1payments(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKAsyncPaymentsContext a_conv = *(LDKAsyncPaymentsContext*)(a_ptr); + a_conv = AsyncPaymentsContext_clone((LDKAsyncPaymentsContext*)untag_ptr(a)); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_async_payments(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageContext_1dnsresolver(JNIEnv *env, jclass clz, int64_t a) { + LDKDNSResolverContext 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 = DNSResolverContext_clone(&a_conv); + LDKMessageContext *ret_copy = MALLOC(sizeof(LDKMessageContext), "LDKMessageContext"); + *ret_copy = MessageContext_dnsresolver(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + 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); @@ -86540,12 +89211,20 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1outbound_1pa return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1inbound_1payment(JNIEnv *env, jclass clz, int8_tArray payment_hash) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1inbound_1payment(JNIEnv *env, jclass clz, int8_tArray payment_hash, int64_t nonce, int8_tArray hmac) { LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_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_inbound_payment(payment_hash_ref); + *ret_copy = OffersContext_inbound_payment(payment_hash_ref, nonce_conv, hmac_ref); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -86557,6 +89236,53 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OffersContext_1eq(JNIEnv * return ret_conv; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsContext_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); + LDKAsyncPaymentsContext this_ptr_conv = *(LDKAsyncPaymentsContext*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + AsyncPaymentsContext_free(this_ptr_conv); +} + +static inline uint64_t AsyncPaymentsContext_clone_ptr(LDKAsyncPaymentsContext *NONNULL_PTR arg) { + LDKAsyncPaymentsContext *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsContext), "LDKAsyncPaymentsContext"); + *ret_copy = AsyncPaymentsContext_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAsyncPaymentsContext* arg_conv = (LDKAsyncPaymentsContext*)untag_ptr(arg); + int64_t ret_conv = AsyncPaymentsContext_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKAsyncPaymentsContext* orig_conv = (LDKAsyncPaymentsContext*)untag_ptr(orig); + LDKAsyncPaymentsContext *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsContext), "LDKAsyncPaymentsContext"); + *ret_copy = AsyncPaymentsContext_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsContext_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); + LDKAsyncPaymentsContext *ret_copy = MALLOC(sizeof(LDKAsyncPaymentsContext), "LDKAsyncPaymentsContext"); + *ret_copy = AsyncPaymentsContext_outbound_payment(payment_id_ref, nonce_conv, hmac_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + 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); @@ -86595,6 +89321,145 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OffersContext_1read(JNIEnv return tag_ptr(ret_conv, true); } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsContext_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKAsyncPaymentsContext* obj_conv = (LDKAsyncPaymentsContext*)untag_ptr(obj); + LDKCVec_u8Z ret_var = AsyncPaymentsContext_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_AsyncPaymentsContext_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_AsyncPaymentsContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AsyncPaymentsContextDecodeErrorZ), "LDKCResult_AsyncPaymentsContextDecodeErrorZ"); + *ret_conv = AsyncPaymentsContext_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_DNSResolverContext_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDNSResolverContext this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DNSResolverContext_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1get_1nonce(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDNSResolverContext this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, *DNSResolverContext_get_nonce(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1set_1nonce(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKDNSResolverContext this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKSixteenBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 16); + (*env)->GetByteArrayRegion(env, val, 0, 16, val_ref.data); + DNSResolverContext_set_nonce(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1new(JNIEnv *env, jclass clz, int8_tArray nonce_arg) { + LDKSixteenBytes nonce_arg_ref; + CHECK((*env)->GetArrayLength(env, nonce_arg) == 16); + (*env)->GetByteArrayRegion(env, nonce_arg, 0, 16, nonce_arg_ref.data); + LDKDNSResolverContext ret_var = DNSResolverContext_new(nonce_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 DNSResolverContext_clone_ptr(LDKDNSResolverContext *NONNULL_PTR arg) { + LDKDNSResolverContext ret_var = DNSResolverContext_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_DNSResolverContext_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDNSResolverContext 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 = DNSResolverContext_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDNSResolverContext 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; + LDKDNSResolverContext ret_var = DNSResolverContext_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_DNSResolverContext_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKDNSResolverContext 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 = DNSResolverContext_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKDNSResolverContext 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; + LDKDNSResolverContext 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 = DNSResolverContext_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKDNSResolverContext 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 = DNSResolverContext_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_DNSResolverContext_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_DNSResolverContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DNSResolverContextDecodeErrorZ), "LDKCResult_DNSResolverContextDecodeErrorZ"); + *ret_conv = DNSResolverContext_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_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); @@ -87398,6 +90263,11 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1invoic return ret_conv; } +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1blinded_1path_1creation_1failed(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_blinded_path_creation_failed()); + return ret_conv; +} + 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); @@ -87424,6 +90294,56 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1read( return tag_ptr(ret_conv, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InboundChannelFunds_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); + LDKInboundChannelFunds this_ptr_conv = *(LDKInboundChannelFunds*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + InboundChannelFunds_free(this_ptr_conv); +} + +static inline uint64_t InboundChannelFunds_clone_ptr(LDKInboundChannelFunds *NONNULL_PTR arg) { + LDKInboundChannelFunds *ret_copy = MALLOC(sizeof(LDKInboundChannelFunds), "LDKInboundChannelFunds"); + *ret_copy = InboundChannelFunds_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InboundChannelFunds_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInboundChannelFunds* arg_conv = (LDKInboundChannelFunds*)untag_ptr(arg); + int64_t ret_conv = InboundChannelFunds_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InboundChannelFunds_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInboundChannelFunds* orig_conv = (LDKInboundChannelFunds*)untag_ptr(orig); + LDKInboundChannelFunds *ret_copy = MALLOC(sizeof(LDKInboundChannelFunds), "LDKInboundChannelFunds"); + *ret_copy = InboundChannelFunds_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InboundChannelFunds_1push_1msat(JNIEnv *env, jclass clz, int64_t a) { + LDKInboundChannelFunds *ret_copy = MALLOC(sizeof(LDKInboundChannelFunds), "LDKInboundChannelFunds"); + *ret_copy = InboundChannelFunds_push_msat(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InboundChannelFunds_1dual_1funded(JNIEnv *env, jclass clz) { + LDKInboundChannelFunds *ret_copy = MALLOC(sizeof(LDKInboundChannelFunds), "LDKInboundChannelFunds"); + *ret_copy = InboundChannelFunds_dual_funded(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InboundChannelFunds_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKInboundChannelFunds* a_conv = (LDKInboundChannelFunds*)untag_ptr(a); + LDKInboundChannelFunds* b_conv = (LDKInboundChannelFunds*)untag_ptr(b); + jboolean ret_conv = InboundChannelFunds_eq(a_conv, b_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); @@ -87503,7 +90423,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1funding_1tx_1broadca return ret_ref; } -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) { +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, int64_t payment_id) { 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); @@ -87532,13 +90452,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimable(J 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)); + 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)); 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); + *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, payment_id_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -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) { +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, int64_t payment_id) { 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); @@ -87575,8 +90499,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed(JNI 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* 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)); 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); + *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, payment_id_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -87804,7 +90732,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs(J return ret_ref; } -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) { +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, int8_tArray prev_node_id, int8_tArray next_node_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); @@ -87823,6 +90751,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded(J 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)); + LDKPublicKey prev_node_id_ref; + CHECK((*env)->GetArrayLength(env, prev_node_id) == 33); + (*env)->GetByteArrayRegion(env, prev_node_id, 0, 33, prev_node_id_ref.compressed_form); + LDKPublicKey next_node_id_ref; + CHECK((*env)->GetArrayLength(env, next_node_id) == 33); + (*env)->GetByteArrayRegion(env, next_node_id, 0, 33, next_node_id_ref.compressed_form); 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); @@ -87836,7 +90770,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded(J 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); + *ret_copy = Event_payment_forwarded(prev_channel_id_conv, next_channel_id_conv, prev_user_channel_id_conv, next_user_channel_id_conv, prev_node_id_ref, next_node_id_ref, 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; } @@ -87897,7 +90831,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1ready(JNIEn 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) { +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, int64_t last_local_balance_msat) { LDKChannelId channel_id_conv; channel_id_conv.inner = untag_ptr(channel_id); channel_id_conv.is_owned = ptr_is_owned(channel_id); @@ -87922,8 +90856,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1closed(JNIE 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); + void* last_local_balance_msat_ptr = untag_ptr(last_local_balance_msat); + CHECK_ACCESS(last_local_balance_msat_ptr); + LDKCOption_u64Z last_local_balance_msat_conv = *(LDKCOption_u64Z*)(last_local_balance_msat_ptr); + last_local_balance_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(last_local_balance_msat)); 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); + *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, last_local_balance_msat_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -87944,7 +90882,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1discard_1funding(JNI 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, jboolean is_announced, int64_t params) { +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 channel_negotiation_type, 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); @@ -87953,6 +90891,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1open_1channel_1reque 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_negotiation_type_ptr = untag_ptr(channel_negotiation_type); + CHECK_ACCESS(channel_negotiation_type_ptr); + LDKInboundChannelFunds channel_negotiation_type_conv = *(LDKInboundChannelFunds*)(channel_negotiation_type_ptr); + channel_negotiation_type_conv = InboundChannelFunds_clone((LDKInboundChannelFunds*)untag_ptr(channel_negotiation_type)); LDKChannelTypeFeatures channel_type_conv; channel_type_conv.inner = untag_ptr(channel_type); channel_type_conv.is_owned = ptr_is_owned(channel_type); @@ -87964,7 +90906,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1open_1channel_1reque 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); + *ret_copy = Event_open_channel_request(temporary_channel_id_conv, counterparty_node_id_ref, funding_satoshis, channel_negotiation_type_conv, channel_type_conv, is_announced, params_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -92709,6 +95651,82 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1sh return ret_conv; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1dual_1fund_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_dual_fund_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1dual_1fund_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_dual_fund_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1dual_1fund(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_dual_fund(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1dual_1fund_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_dual_fund_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1dual_1fund_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_dual_fund_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1dual_1fund(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_dual_fund(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1dual_1fund(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_dual_fund(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1dual_1fund(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_dual_fund(&this_arg_conv); + return ret_conv; +} + 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); @@ -93363,6 +96381,34 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1sup return ret_conv; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1trampoline_1routing_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_trampoline_routing_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1trampoline_1routing_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_trampoline_routing_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1supports_1trampoline_1routing(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_trampoline_routing(&this_arg_conv); + return ret_conv; +} + 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); @@ -93393,6 +96439,54 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1req return ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1trampoline_1routing(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_trampoline_routing(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1dns_1resolution_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_dns_resolution_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1dns_1resolution_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_dns_resolution_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1dns_1resolution(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_dns_resolution(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1dns_1resolution(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_dns_resolution(&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; this_obj_conv.inner = untag_ptr(this_obj); @@ -94060,6 +97154,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemStore_1as_1KVStor return tag_ptr(ret_ret, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemStore_1as_1MigratableKVStore(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKFilesystemStore this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKMigratableKVStore* ret_ret = MALLOC(sizeof(LDKMigratableKVStore), "LDKMigratableKVStore"); + *ret_ret = FilesystemStore_as_MigratableKVStore(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKBackgroundProcessor this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -94196,176 +97301,59 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1stop(J return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_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); - LDKBolt11ParseError this_ptr_conv = *(LDKBolt11ParseError*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Bolt11ParseError_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBolt11ParseError this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt11ParseError_free(this_obj_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBolt11ParseError 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; + LDKBolt11ParseError 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 = Bolt11ParseError_eq(&a_conv, &b_conv); + return ret_conv; } static inline uint64_t Bolt11ParseError_clone_ptr(LDKBolt11ParseError *NONNULL_PTR arg) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKBolt11ParseError ret_var = Bolt11ParseError_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_Bolt11ParseError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBolt11ParseError* arg_conv = (LDKBolt11ParseError*)untag_ptr(arg); - int64_t ret_conv = Bolt11ParseError_clone_ptr(arg_conv); + LDKBolt11ParseError 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 = Bolt11ParseError_clone_ptr(&arg_conv); return ret_conv; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBolt11ParseError* orig_conv = (LDKBolt11ParseError*)untag_ptr(orig); - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1bech32_1error(JNIEnv *env, jclass clz, int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKBech32Error a_conv = *(LDKBech32Error*)(a_ptr); - a_conv = Bech32Error_clone((LDKBech32Error*)untag_ptr(a)); - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_bech32_error(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1parse_1amount_1error(JNIEnv *env, jclass clz, int32_t a) { - - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_parse_amount_error((LDKError){ ._dummy = 0 }); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1malformed_1signature(JNIEnv *env, jclass clz, jclass a) { - LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_java(env, a); - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_malformed_signature(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1bad_1prefix(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_bad_prefix(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1unknown_1currency(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_unknown_currency(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1unknown_1si_1prefix(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_unknown_si_prefix(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1malformed_1hrp(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_malformed_hrp(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1too_1short_1data_1part(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_too_short_data_part(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1unexpected_1end_1of_1tagged_1fields(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_unexpected_end_of_tagged_fields(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1description_1decode_1error(JNIEnv *env, jclass clz, int32_t a) { - - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_description_decode_error((LDKError){ ._dummy = 0 }); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1padding_1error(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_padding_error(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1integer_1overflow_1error(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_integer_overflow_error(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1invalid_1seg_1wit_1program_1length(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_invalid_seg_wit_program_length(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1invalid_1pub_1key_1hash_1length(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_invalid_pub_key_hash_length(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1invalid_1script_1hash_1length(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_invalid_script_hash_length(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1invalid_1recovery_1id(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_invalid_recovery_id(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1invalid_1slice_1length(JNIEnv *env, jclass clz, jstring a) { - LDKStr a_conv = java_to_owned_str(env, a); - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_invalid_slice_length(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1skip(JNIEnv *env, jclass clz) { - LDKBolt11ParseError *ret_copy = MALLOC(sizeof(LDKBolt11ParseError), "LDKBolt11ParseError"); - *ret_copy = Bolt11ParseError_skip(); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKBolt11ParseError 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; + LDKBolt11ParseError ret_var = Bolt11ParseError_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_Bolt11ParseError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBolt11ParseError* a_conv = (LDKBolt11ParseError*)untag_ptr(a); - LDKBolt11ParseError* b_conv = (LDKBolt11ParseError*)untag_ptr(b); - jboolean ret_conv = Bolt11ParseError_eq(a_conv, b_conv); - return ret_conv; -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -94396,10 +97384,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1clone } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1parse_1error(JNIEnv *env, jclass clz, int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKBolt11ParseError a_conv = *(LDKBolt11ParseError*)(a_ptr); - a_conv = Bolt11ParseError_clone((LDKBolt11ParseError*)untag_ptr(a)); + LDKBolt11ParseError 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 = Bolt11ParseError_clone(&a_conv); LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError"); *ret_copy = ParseOrSemanticError_parse_error(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); @@ -94484,6 +97473,74 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11Invoice_1hash(JNIEnv return ret_conv; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_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); + LDKBolt11InvoiceDescription this_ptr_conv = *(LDKBolt11InvoiceDescription*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Bolt11InvoiceDescription_free(this_ptr_conv); +} + +static inline uint64_t Bolt11InvoiceDescription_clone_ptr(LDKBolt11InvoiceDescription *NONNULL_PTR arg) { + LDKBolt11InvoiceDescription *ret_copy = MALLOC(sizeof(LDKBolt11InvoiceDescription), "LDKBolt11InvoiceDescription"); + *ret_copy = Bolt11InvoiceDescription_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBolt11InvoiceDescription* arg_conv = (LDKBolt11InvoiceDescription*)untag_ptr(arg); + int64_t ret_conv = Bolt11InvoiceDescription_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBolt11InvoiceDescription* orig_conv = (LDKBolt11InvoiceDescription*)untag_ptr(orig); + LDKBolt11InvoiceDescription *ret_copy = MALLOC(sizeof(LDKBolt11InvoiceDescription), "LDKBolt11InvoiceDescription"); + *ret_copy = Bolt11InvoiceDescription_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1direct(JNIEnv *env, jclass clz, int64_t a) { + LDKDescription 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 = Description_clone(&a_conv); + LDKBolt11InvoiceDescription *ret_copy = MALLOC(sizeof(LDKBolt11InvoiceDescription), "LDKBolt11InvoiceDescription"); + *ret_copy = Bolt11InvoiceDescription_direct(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1hash(JNIEnv *env, jclass clz, int64_t a) { + LDKSha256 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 = Sha256_clone(&a_conv); + LDKBolt11InvoiceDescription *ret_copy = MALLOC(sizeof(LDKBolt11InvoiceDescription), "LDKBolt11InvoiceDescription"); + *ret_copy = Bolt11InvoiceDescription_hash(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBolt11InvoiceDescription* a_conv = (LDKBolt11InvoiceDescription*)untag_ptr(a); + LDKBolt11InvoiceDescription* b_conv = (LDKBolt11InvoiceDescription*)untag_ptr(b); + jboolean ret_conv = Bolt11InvoiceDescription_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1to_1str(JNIEnv *env, jclass clz, int64_t o) { + LDKBolt11InvoiceDescription* o_conv = (LDKBolt11InvoiceDescription*)untag_ptr(o); + LDKStr ret_str = Bolt11InvoiceDescription_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_SignedRawBolt11Invoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKSignedRawBolt11Invoice this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -96101,6 +99158,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1new(JNIEnv *en return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1empty(JNIEnv *env, jclass clz) { + LDKDescription ret_var = Description_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_Description_1into_1inner(JNIEnv *env, jclass clz, int64_t this_arg) { LDKDescription this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -96402,8 +99467,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawBolt11Invoice_1fro } JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1to_1str(JNIEnv *env, jclass clz, int64_t o) { - LDKBolt11ParseError* o_conv = (LDKBolt11ParseError*)untag_ptr(o); - LDKStr ret_str = Bolt11ParseError_to_str(o_conv); + LDKBolt11ParseError 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 = Bolt11ParseError_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; diff --git a/src/main/jni/org_ldk_impl_bindings.h b/src/main/jni/org_ldk_impl_bindings.h index d9d4448e..587d012c 100644 --- a/src/main/jni/org_ldk_impl_bindings.h +++ b/src/main/jni/org_ldk_impl_bindings.h @@ -175,30 +175,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RetryDecodeErrorZ_1g JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RetryDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKAPIError_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKAPIError; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NoneAPIErrorZ_get_ok - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NoneAPIErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCOption_ThirtyTwoBytesZ_ref_from_ptr @@ -263,6 +239,238 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFields JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKDNSResolverMessage_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKDNSResolverMessage; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDNSResolverMessage_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_DNSResolverMessageResponseInstructionZ_get_a + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageResponseInstructionZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_DNSResolverMessageResponseInstructionZ_get_b + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageResponseInstructionZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1DNSResolverMessageResponseInstructionZZ_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKDestination_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKDestination; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1ptr + (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: LDKAsyncPaymentsContext_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKAsyncPaymentsContext; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAsyncPaymentsContext_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * 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_DNSResolverMessageMessageSendInstructionsZ_get_a + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageMessageSendInstructionsZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_DNSResolverMessageMessageSendInstructionsZ_get_b + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageMessageSendInstructionsZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DNSResolverMessageDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DNSResolverMessageDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HumanReadableNameNoneZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HumanReadableNameNoneZ_get_err + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HumanReadableNameDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HumanReadableNameDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_DNSSECQueryDNSResolverContextZ_get_a + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSSECQueryDNSResolverContextZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_DNSSECQueryDNSResolverContextZ_get_b + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSSECQueryDNSResolverContextZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_get_err + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_HumanReadableNameThirtyTwoBytesZ_get_a + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HumanReadableNameThirtyTwoBytesZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_HumanReadableNameThirtyTwoBytesZ_get_b + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HumanReadableNameThirtyTwoBytesZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_get_a + * Signature: (J)[J + */ +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_get_b + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_get_a + * Signature: (J)[J + */ +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_get_b + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok @@ -799,6 +1007,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1sign_1hol JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1sign_1channel_1announcement_1with_1funding_1key (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: EcdsaChannelSigner_sign_splicing_funding_input + * Signature: (J[BJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1sign_1splicing_1funding_1input + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_EcdsaChannelSignerDecodeErrorZ_get_ok @@ -1111,38 +1327,6 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPa JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: CResult_OnionMessagePathNoneZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_OnionMessagePathNoneZ_get_err - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_CVec_BlindedMessagePathZNoneZ_get_ok - * Signature: (J)[J - */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_CVec_BlindedMessagePathZNoneZ_get_err - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1get_1err - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: CResult_InFlightHtlcsDecodeErrorZ_get_ok @@ -1503,118 +1687,6 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_C4Tuple_1OutPointChannel JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C4Tuple_1OutPointChannelIdCVec_1MonitorEventZPublicKeyZ_1get_1d (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: CResult_InitFeaturesDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_InitFeaturesDecodeErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelFeaturesDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelFeaturesDecodeErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NodeFeaturesDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NodeFeaturesDecodeErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopFeaturesDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopFeaturesDecodeErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: CResult_OfferIdDecodeErrorZ_get_ok @@ -1665,34 +1737,18 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1OfferBolt12Semanti /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok + * Method: CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err + * Method: CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_get_err * Signature: (J)Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err - * Signature: (J)Lorg/ldk/enums/Bolt12SemanticError; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_1get_1err +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -2175,6 +2231,14 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u16Z_1get_1b JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1u64u16ZZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKAPIError_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKAPIError; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ChannelIdAPIErrorZ_get_ok @@ -2201,26 +2265,18 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRecentPaymentDetails_1re /* * Class: org_ldk_impl_bindings - * Method: LDKPaymentSendFailure_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKPaymentSendFailure; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_1from_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_get_ok + * Method: CResult_NoneAPIErrorZ_get_ok * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1ok +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_get_err + * Method: CResult_NoneAPIErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -2241,18 +2297,34 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendF /* * Class: org_ldk_impl_bindings - * Method: CResult_ThirtyTwoBytesPaymentSendFailureZ_get_ok - * Signature: (J)[B + * Method: LDKCOption_OffersContextZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_OffersContextZ; */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1get_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1OffersContextZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ThirtyTwoBytesPaymentSendFailureZ_get_err + * 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: CResult_NoneBolt12PaymentErrorZ_get_ok + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneBolt12PaymentErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -2289,26 +2361,26 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ThirtyTwoBytesT /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_get_ok - * Signature: (J)J + * Method: LDKProbeSendFailure_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKProbeSendFailure; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1get_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKProbeSendFailure_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_get_err + * Method: CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKProbeSendFailure_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKProbeSendFailure; + * Method: CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_get_err + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKProbeSendFailure_1ref_1from_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -2343,6 +2415,54 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ChannelIdPublicKeyZ_ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ChannelIdPublicKeyZ_1get_1b (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_PublicKeyChannelIdZ_get_a + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyChannelIdZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_PublicKeyChannelIdZ_get_b + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyChannelIdZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKCOption_C2Tuple_PublicKeyChannelIdZZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_C2Tuple_PublicKeyChannelIdZZ; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1PublicKeyChannelIdZZ_1ref_1from_1ptr + (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: CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok @@ -2399,22 +2519,6 @@ 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 @@ -2447,30 +2551,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OffersMessageRespons JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1OffersMessageResponseInstructionZZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKDestination_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKDestination; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * 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 @@ -2705,10 +2785,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNodeSigner_1new /* * Class: org_ldk_impl_bindings - * Method: NodeSigner_get_inbound_payment_key_material - * Signature: (J)[B + * Method: NodeSigner_get_inbound_payment_key + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeSigner_1get_1inbound_1payment_1key_1material +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeSigner_1get_1inbound_1payment_1key (JNIEnv *, jclass, jlong); /* @@ -2735,14 +2815,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeSigner_1ecdh JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeSigner_1sign_1invoice (JNIEnv *, jclass, jlong, jlong, jobject); -/* - * Class: org_ldk_impl_bindings - * Method: NodeSigner_sign_bolt12_invoice_request - * Signature: (JJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeSigner_1sign_1bolt12_1invoice_1request - (JNIEnv *, jclass, jlong, jlong); - /* * Class: org_ldk_impl_bindings * Method: NodeSigner_sign_bolt12_invoice @@ -2825,75 +2897,99 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1get_1est_1sat_1p /* * Class: org_ldk_impl_bindings - * Method: LDKMessageRouter_new - * Signature: (Lorg/ldk/impl/bindings/LDKMessageRouter;)J + * Method: LDKRouter_new + * Signature: (Lorg/ldk/impl/bindings/LDKRouter;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMessageRouter_1new +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRouter_1new (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: MessageRouter_find_path - * Signature: (J[B[[BJ)J + * Method: Router_find_route + * Signature: (J[BJ[JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageRouter_1find_1path - (JNIEnv *, jclass, jlong, jbyteArray, jobjectArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Router_1find_1route + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlongArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageRouter_create_blinded_paths - * Signature: (J[BJ[[B)J + * Method: Router_find_route_with_id + * Signature: (J[BJ[JJ[B[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageRouter_1create_1blinded_1paths - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jobjectArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Router_1find_1route_1with_1id + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlongArray, jlong, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: MessageRouter_create_compact_blinded_paths - * Signature: (J[BJ[J)J + * Method: Router_create_blinded_payment_paths + * Signature: (J[B[JJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageRouter_1create_1compact_1blinded_1paths - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Router_1create_1blinded_1payment_1paths + (JNIEnv *, jclass, jlong, jbyteArray, jlongArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKRouter_new - * Signature: (Lorg/ldk/impl/bindings/LDKRouter;Lorg/ldk/impl/bindings/LDKMessageRouter;)J + * Method: CResult_OnionMessagePathNoneZ_get_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRouter_1new - (JNIEnv *, jclass, jobject, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKRouter_get_MessageRouter - * Signature: (J)J + * Method: CResult_OnionMessagePathNoneZ_get_err + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRouter_1get_1MessageRouter +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Router_find_route - * Signature: (J[BJ[JJ)J + * Method: CResult_CVec_BlindedMessagePathZNoneZ_get_ok + * Signature: (J)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Router_1find_1route - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlongArray, jlong); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Router_find_route_with_id - * Signature: (J[BJ[JJ[B[B)J + * Method: CResult_CVec_BlindedMessagePathZNoneZ_get_err + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Router_1find_1route_1with_1id - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlongArray, jlong, jbyteArray, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Router_create_blinded_payment_paths - * Signature: (J[B[JJJ)J + * Method: LDKMessageRouter_new + * Signature: (Lorg/ldk/impl/bindings/LDKMessageRouter;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Router_1create_1blinded_1payment_1paths - (JNIEnv *, jclass, jlong, jbyteArray, jlongArray, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMessageRouter_1new + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: MessageRouter_find_path + * Signature: (J[B[[BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageRouter_1find_1path + (JNIEnv *, jclass, jlong, jbyteArray, jobjectArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: MessageRouter_create_blinded_paths + * Signature: (J[BJ[[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageRouter_1create_1blinded_1paths + (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 @@ -3151,6 +3247,22 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ThirtyTwoBytesC JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ThirtyTwoBytesCVec_1C2Tuple_1u32TxOutZZZ_1get_1b (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_boolboolZ_get_a + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_C2Tuple_1boolboolZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_boolboolZ_get_b + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_C2Tuple_1boolboolZ_1get_1b + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKBalance_ref_from_ptr @@ -3479,6 +3591,46 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1StrZIOE JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1StrZIOErrorZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C3Tuple_StrStrStrZ_get_a + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C3Tuple_StrStrStrZ_get_b + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C3Tuple_StrStrStrZ_get_c + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1get_1c + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_get_ok + * Signature: (J)[J + */ +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_get_err + * Signature: (J)Lorg/ldk/enums/IOError; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_get_ok @@ -3513,18 +3665,34 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwo /* * Class: org_ldk_impl_bindings - * Method: CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok + * Method: CResult_MonitorNameIOErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1MonitorNameIOErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err - * Signature: (J)Lorg/ldk/enums/Bolt12SemanticError; + * Method: CResult_MonitorNameIOErrorZ_get_err + * Signature: (J)Lorg/ldk/enums/IOError; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1MonitorNameIOErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UpdateNameIOErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateNameIOErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UpdateNameIOErrorZ_get_err + * Signature: (J)Lorg/ldk/enums/IOError; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1get_1err +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateNameIOErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -3591,6 +3759,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceWithDerivedSi JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceRequestDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceRequestDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok @@ -5127,6 +5311,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PaymentFail JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1U128Z_1ref_1from_1ptr (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKInboundChannelFunds_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKInboundChannelFunds; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKInboundChannelFunds_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKBumpTransactionEvent_ref_from_ptr @@ -5183,14 +5375,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonceDecodeErrorZ_1g 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 - * Signature: (J)Lorg/ldk/impl/bindings/LDKBolt11ParseError; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBolt11ParseError_1ref_1from_1ptr - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: CResult_SiPrefixBolt11ParseErrorZ_get_ok @@ -5479,6 +5663,118 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelIdDecodeError JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelIdDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InitFeaturesDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InitFeaturesDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelFeaturesDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelFeaturesDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeFeaturesDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeFeaturesDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_Bolt11InvoiceFeaturesDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_Bolt12InvoiceFeaturesDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedHopFeaturesDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedHopFeaturesDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: C2Tuple__u832u16Z_get_a @@ -5575,22 +5871,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentContextDecode JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentContextDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: CResult_UnknownPaymentContextDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_UnknownPaymentContextDecodeErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: CResult_Bolt12OfferContextDecodeErrorZ_get_ok @@ -5791,30 +6071,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErro JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_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: CResult_InvoiceErrorDecodeErrorZ_get_ok @@ -6231,6 +6487,62 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeE JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AsyncPaymentsContextDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AsyncPaymentsContextDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DNSResolverContextDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DNSResolverContextDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKMigratableKVStore_new + * Signature: (Lorg/ldk/impl/bindings/LDKMigratableKVStore;Lorg/ldk/impl/bindings/LDKKVStore;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMigratableKVStore_1new + (JNIEnv *, jclass, jobject, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKMigratableKVStore_get_KVStore + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMigratableKVStore_1get_1KVStore + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: MigratableKVStore_list_all_keys + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MigratableKVStore_1list_1all_1keys + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKPersister_new @@ -6423,6 +6735,30 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1process_1pending_1events (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKVerification_new + * Signature: (Lorg/ldk/impl/bindings/LDKVerification;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKVerification_1new + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: Verification_hmac_for_offer_payment + * Signature: (JJJ)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Verification_1hmac_1for_1offer_1payment + (JNIEnv *, jclass, jlong, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Verification_verify_for_offer_payment + * Signature: (J[BJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Verification_1verify_1for_1offer_1payment + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKFailureCode_ref_from_ptr @@ -6431,6 +6767,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1process_1pendi JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFailureCode_1ref_1from_1ptr (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKBolt11InvoiceDescription_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKBolt11InvoiceDescription; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBolt11InvoiceDescription_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKMessageSendEventsProvider_new @@ -6743,6 +7087,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1provid JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1get_1chain_1hashes (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_message_received + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1message_1received + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKOffersMessageHandler_new @@ -6777,19 +7129,19 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKAsyncPaymentsMessageHandle /* * Class: org_ldk_impl_bindings - * Method: AsyncPaymentsMessageHandler_held_htlc_available + * Method: AsyncPaymentsMessageHandler_handle_held_htlc_available * Signature: (JJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1held_1htlc_1available +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1handle_1held_1htlc_1available (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: AsyncPaymentsMessageHandler_release_held_htlc - * Signature: (JJ)V + * Method: AsyncPaymentsMessageHandler_handle_release_held_htlc + * Signature: (JJJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1release_1held_1htlc - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1handle_1release_1held_1htlc + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -6799,6 +7151,46 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1r JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessageHandler_1release_1pending_1messages (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKDNSResolverMessageHandler_new + * Signature: (Lorg/ldk/impl/bindings/LDKDNSResolverMessageHandler;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKDNSResolverMessageHandler_1new + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverMessageHandler_handle_dnssec_query + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSResolverMessageHandler_1handle_1dnssec_1query + (JNIEnv *, jclass, jlong, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverMessageHandler_handle_dnssec_proof + * Signature: (JJJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DNSResolverMessageHandler_1handle_1dnssec_1proof + (JNIEnv *, jclass, jlong, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverMessageHandler_provided_node_features + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSResolverMessageHandler_1provided_1node_1features + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverMessageHandler_release_pending_messages + * Signature: (J)[J + */ +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_DNSResolverMessageHandler_1release_1pending_1messages + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKNodeIdLookUp_new @@ -6834,26 +7226,26 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get /* * Class: org_ldk_impl_bindings * Method: RoutingMessageHandler_handle_node_announcement - * Signature: (JJ)J + * Signature: (J[BJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1node_1announcement - (JNIEnv *, jclass, jlong, jlong); + (JNIEnv *, jclass, jlong, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings * Method: RoutingMessageHandler_handle_channel_announcement - * Signature: (JJ)J + * Signature: (J[BJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1announcement - (JNIEnv *, jclass, jlong, jlong); + (JNIEnv *, jclass, jlong, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings * Method: RoutingMessageHandler_handle_channel_update - * Signature: (JJ)J + * Signature: (J[BJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1update - (JNIEnv *, jclass, jlong, jlong); + (JNIEnv *, jclass, jlong, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings @@ -7143,14 +7535,6 @@ 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 @@ -7871,70 +8255,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RetryDecodeErrorZ_1c JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RetryDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NoneAPIErrorZ_ok - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NoneAPIErrorZ_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NoneAPIErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NoneAPIErrorZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NoneAPIErrorZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NoneAPIErrorZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CVec_CResult_NoneAPIErrorZZ_free - * Signature: ([J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CResult_1NoneAPIErrorZZ_1free - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: CVec_APIErrorZ_free - * Signature: ([J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1APIErrorZ_1free - (JNIEnv *, jclass, jlongArray); - /* * Class: org_ldk_impl_bindings * Method: COption_ThirtyTwoBytesZ_some @@ -8151,6 +8471,526 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFields JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsNoneZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_DNSResolverMessageResponseInstructionZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageResponseInstructionZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_DNSResolverMessageResponseInstructionZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageResponseInstructionZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_DNSResolverMessageResponseInstructionZ_new + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageResponseInstructionZ_1new + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_DNSResolverMessageResponseInstructionZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageResponseInstructionZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_some + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1DNSResolverMessageResponseInstructionZZ_1some + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_none + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1DNSResolverMessageResponseInstructionZZ_1none + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1DNSResolverMessageResponseInstructionZZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1DNSResolverMessageResponseInstructionZZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_DNSResolverMessageResponseInstructionZZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1DNSResolverMessageResponseInstructionZZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_DNSResolverMessageMessageSendInstructionsZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageMessageSendInstructionsZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_DNSResolverMessageMessageSendInstructionsZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageMessageSendInstructionsZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_DNSResolverMessageMessageSendInstructionsZ_new + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageMessageSendInstructionsZ_1new + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_DNSResolverMessageMessageSendInstructionsZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSResolverMessageMessageSendInstructionsZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_C2Tuple_DNSResolverMessageMessageSendInstructionsZZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1DNSResolverMessageMessageSendInstructionsZZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DNSResolverMessageDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DNSResolverMessageDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DNSResolverMessageDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DNSResolverMessageDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DNSResolverMessageDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DNSResolverMessageDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverMessageDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HumanReadableNameNoneZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HumanReadableNameNoneZ_err + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1err + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HumanReadableNameNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HumanReadableNameNoneZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HumanReadableNameNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HumanReadableNameNoneZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameNoneZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HumanReadableNameDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HumanReadableNameDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HumanReadableNameDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HumanReadableNameDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HumanReadableNameDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HumanReadableNameDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HumanReadableNameDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_DNSSECQueryDNSResolverContextZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSSECQueryDNSResolverContextZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_DNSSECQueryDNSResolverContextZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSSECQueryDNSResolverContextZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_DNSSECQueryDNSResolverContextZ_new + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSSECQueryDNSResolverContextZ_1new + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_DNSSECQueryDNSResolverContextZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1DNSSECQueryDNSResolverContextZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_err + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1err + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_DNSSECQueryDNSResolverContextZNoneZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1DNSSECQueryDNSResolverContextZNoneZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HumanReadableNameThirtyTwoBytesZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_HumanReadableNameThirtyTwoBytesZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HumanReadableNameThirtyTwoBytesZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_HumanReadableNameThirtyTwoBytesZ_new + * Signature: (J[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HumanReadableNameThirtyTwoBytesZ_1new + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_HumanReadableNameThirtyTwoBytesZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HumanReadableNameThirtyTwoBytesZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_new + * Signature: ([JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZ_1new + (JNIEnv *, jclass, jlongArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_some + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_1some + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_none + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_1none + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_new + * Signature: ([JLjava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZ_1new + (JNIEnv *, jclass, jlongArray, jstring); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_some + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_1some + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_none + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_1none + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok @@ -8295,6 +9135,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_BlindedPaymentPathZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BlindedPaymentPathZ_1free + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: CVec_StrZ_free @@ -9847,14 +10695,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: CVec_BlindedPaymentPathZ_free - * Signature: ([J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BlindedPaymentPathZ_1free - (JNIEnv *, jclass, jlongArray); - /* * Class: org_ldk_impl_bindings * Method: CResult_CVec_BlindedPaymentPathZNoneZ_ok @@ -9903,118 +10743,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPayment JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedPaymentPathZNoneZ_1clone (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: CVec_PublicKeyZ_free - * Signature: ([[B)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free - (JNIEnv *, jclass, jobjectArray); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_OnionMessagePathNoneZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_OnionMessagePathNoneZ_err - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1err - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_OnionMessagePathNoneZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_OnionMessagePathNoneZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_OnionMessagePathNoneZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_OnionMessagePathNoneZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_CVec_BlindedMessagePathZNoneZ_ok - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1ok - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_CVec_BlindedMessagePathZNoneZ_err - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1err - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_CVec_BlindedMessagePathZNoneZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_CVec_BlindedMessagePathZNoneZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_CVec_BlindedMessagePathZNoneZ_clone - * Signature: (J)J - */ -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 @@ -10439,6 +11167,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeEr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CVec_PublicKeyZ_free + * Signature: ([[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free + (JNIEnv *, jclass, jobjectArray); + /* * Class: org_ldk_impl_bindings * Method: CResult_FixedPenaltyScorerDecodeErrorZ_ok @@ -10919,342 +11655,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C4Tuple_1OutPointChannelIdCVec JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C4Tuple_1OutPointChannelIdCVec_1MonitorEventZPublicKeyZZ_1free (JNIEnv *, jclass, jlongArray); -/* - * Class: org_ldk_impl_bindings - * Method: CResult_InitFeaturesDecodeErrorZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_InitFeaturesDecodeErrorZ_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_InitFeaturesDecodeErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_InitFeaturesDecodeErrorZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_InitFeaturesDecodeErrorZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_InitFeaturesDecodeErrorZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelFeaturesDecodeErrorZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelFeaturesDecodeErrorZ_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelFeaturesDecodeErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelFeaturesDecodeErrorZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelFeaturesDecodeErrorZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelFeaturesDecodeErrorZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NodeFeaturesDecodeErrorZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NodeFeaturesDecodeErrorZ_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NodeFeaturesDecodeErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NodeFeaturesDecodeErrorZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NodeFeaturesDecodeErrorZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NodeFeaturesDecodeErrorZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopFeaturesDecodeErrorZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopFeaturesDecodeErrorZ_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopFeaturesDecodeErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopFeaturesDecodeErrorZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopFeaturesDecodeErrorZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: CResult_OfferIdDecodeErrorZ_ok @@ -11401,66 +11801,34 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OfferBolt12SemanticE /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err - * Signature: (Lorg/ldk/enums/Bolt12SemanticError;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_1err - (JNIEnv *, jclass, jobject); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok + * Method: CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err + * Method: CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_err * Signature: (Lorg/ldk/enums/Bolt12SemanticError;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_1err (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok + * Method: CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free + * Method: CResult_InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestWithDerivedPayerSigningPubkeyBuilderBolt12SemanticErrorZ_1free (JNIEnv *, jclass, jlong); /* @@ -12769,50 +13137,50 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RecentPaymentDetailsZ_1f /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_ok + * Method: CResult_NoneAPIErrorZ_ok * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_err + * Method: CResult_NoneAPIErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_is_ok + * Method: CResult_NoneAPIErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_free + * Method: CResult_NoneAPIErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_clone_ptr + * Method: CResult_NoneAPIErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_clone + * Method: CResult_NoneAPIErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone (JNIEnv *, jclass, jlong); /* @@ -12865,50 +13233,90 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFai /* * Class: org_ldk_impl_bindings - * Method: CResult_ThirtyTwoBytesPaymentSendFailureZ_ok - * Signature: ([B)J + * Method: COption_OffersContextZ_some + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1ok - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1some + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_OffersContextZ_none + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1none + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_OffersContextZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_OffersContextZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_OffersContextZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneBolt12PaymentErrorZ_ok + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1ok + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_ThirtyTwoBytesPaymentSendFailureZ_err + * Method: CResult_NoneBolt12PaymentErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ThirtyTwoBytesPaymentSendFailureZ_is_ok + * Method: CResult_NoneBolt12PaymentErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ThirtyTwoBytesPaymentSendFailureZ_free + * Method: CResult_NoneBolt12PaymentErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ThirtyTwoBytesPaymentSendFailureZ_clone_ptr + * Method: CResult_NoneBolt12PaymentErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ThirtyTwoBytesPaymentSendFailureZ_clone + * Method: CResult_NoneBolt12PaymentErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesPaymentSendFailureZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneBolt12PaymentErrorZ_1clone (JNIEnv *, jclass, jlong); /* @@ -12993,50 +13401,50 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ThirtyTwoBytesThirtyT /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok + * Method: CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_err + * Method: CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok + * Method: CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free + * Method: CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone_ptr + * Method: CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone + * Method: CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBytesThirtyTwoBytesZProbeSendFailureZ_1clone (JNIEnv *, jclass, jlong); /* @@ -13143,6 +13551,126 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1ChannelIdPublic JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelIdZ_1free (JNIEnv *, jclass, jlongArray); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_PublicKeyChannelIdZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyChannelIdZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_PublicKeyChannelIdZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyChannelIdZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_PublicKeyChannelIdZ_new + * Signature: ([BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyChannelIdZ_1new + (JNIEnv *, jclass, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_PublicKeyChannelIdZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyChannelIdZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_PublicKeyChannelIdZZ_some + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1PublicKeyChannelIdZZ_1some + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_PublicKeyChannelIdZZ_none + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1PublicKeyChannelIdZZ_1none + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_PublicKeyChannelIdZZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1PublicKeyChannelIdZZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_PublicKeyChannelIdZZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1PublicKeyChannelIdZZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_PublicKeyChannelIdZZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1PublicKeyChannelIdZZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * 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: CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok @@ -13231,6 +13759,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1StrZ_1clone_1ptr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1StrZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CVec_DestinationZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1DestinationZ_1free + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok @@ -13327,46 +13863,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesAPIErr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ThirtyTwoBytesAPIErrorZ_1clone (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: COption_OffersContextZ_some - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1some - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_OffersContextZ_none - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1none - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_OffersContextZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_OffersContextZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_OffersContextZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1OffersContextZ_1clone - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: C2Tuple_OffersMessageResponseInstructionZ_clone_ptr @@ -14543,6 +15039,38 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1ThirtyTwoBytesCVec_1C JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1ThirtyTwoBytesCVec_1C2Tuple_1u32TxOutZZZZ_1free (JNIEnv *, jclass, jlongArray); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_boolboolZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1boolboolZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_boolboolZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1boolboolZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_boolboolZ_new + * Signature: (ZZ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1boolboolZ_1new + (JNIEnv *, jclass, jboolean, jboolean); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_boolboolZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1boolboolZ_1free + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CVec_BalanceZ_free @@ -15279,6 +15807,94 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1StrZIOErrorZ_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1StrZIOErrorZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C3Tuple_StrStrStrZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C3Tuple_StrStrStrZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C3Tuple_StrStrStrZ_new + * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1new + (JNIEnv *, jclass, jstring, jstring, jstring); + +/* + * Class: org_ldk_impl_bindings + * Method: C3Tuple_StrStrStrZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1StrStrStrZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_C3Tuple_StrStrStrZZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1StrStrStrZZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_ok + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1ok + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_err + * Signature: (Lorg/ldk/enums/IOError;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1err + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_C3Tuple_StrStrStrZZIOErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C3Tuple_1StrStrStrZZIOErrorZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ_free @@ -15385,50 +16001,66 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1ThirtyTwoBy /* * Class: org_ldk_impl_bindings - * Method: CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok + * Method: CResult_MonitorNameIOErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1MonitorNameIOErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err - * Signature: (Lorg/ldk/enums/Bolt12SemanticError;)J + * Method: CResult_MonitorNameIOErrorZ_err + * Signature: (Lorg/ldk/enums/IOError;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1MonitorNameIOErrorZ_1err (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok + * Method: CResult_MonitorNameIOErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1MonitorNameIOErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free + * Method: CResult_MonitorNameIOErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1MonitorNameIOErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr + * Method: CResult_UpdateNameIOErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateNameIOErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone - * Signature: (J)J + * Method: CResult_UpdateNameIOErrorZ_err + * Signature: (Lorg/ldk/enums/IOError;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateNameIOErrorZ_1err + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UpdateNameIOErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedInvoiceRequestBolt12SemanticErrorZ_1clone +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateNameIOErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UpdateNameIOErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateNameIOErrorZ_1free (JNIEnv *, jclass, jlong); /* @@ -15591,6 +16223,54 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceWithDerive JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceRequestDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceRequestDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceRequestDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceRequestDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceRequestDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceRequestDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_InvoiceRequestFieldsDecodeErrorZ_ok @@ -21303,6 +21983,342 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelIdDecodeError JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelIdDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InitFeaturesDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InitFeaturesDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InitFeaturesDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InitFeaturesDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InitFeaturesDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InitFeaturesDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelFeaturesDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelFeaturesDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelFeaturesDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelFeaturesDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelFeaturesDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelFeaturesDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeFeaturesDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeFeaturesDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeFeaturesDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeFeaturesDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeFeaturesDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeFeaturesDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt11InvoiceFeaturesDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1Bolt12InvoiceFeaturesDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedHopFeaturesDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedHopFeaturesDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedHopFeaturesDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedHopFeaturesDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedHopFeaturesDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: C2Tuple__u832u16Z_clone_ptr @@ -21583,54 +22599,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentContextDecode JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentContextDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: CResult_UnknownPaymentContextDecodeErrorZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_UnknownPaymentContextDecodeErrorZ_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_UnknownPaymentContextDecodeErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_UnknownPaymentContextDecodeErrorZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_UnknownPaymentContextDecodeErrorZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnknownPaymentContextDecodeErrorZ_1clone - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: CResult_Bolt12OfferContextDecodeErrorZ_ok @@ -21823,6 +22791,110 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeError JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ResponderDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OnionMessagePathNoneZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OnionMessagePathNoneZ_err + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1err + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OnionMessagePathNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OnionMessagePathNoneZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OnionMessagePathNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OnionMessagePathNoneZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessagePathNoneZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_BlindedMessagePathZNoneZ_ok + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1ok + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_BlindedMessagePathZNoneZ_err + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1err + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_BlindedMessagePathZNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_BlindedMessagePathZNoneZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_BlindedMessagePathZNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1BlindedMessagePathZNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_BlindedMessagePathZNoneZ_clone + * Signature: (J)J + */ +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: COption_MessageContextZ_some @@ -22143,54 +23215,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErro 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: CResult_InvoiceErrorDecodeErrorZ_ok @@ -23039,6 +24063,102 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeE JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OffersContextDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AsyncPaymentsContextDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AsyncPaymentsContextDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AsyncPaymentsContextDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AsyncPaymentsContextDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AsyncPaymentsContextDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AsyncPaymentsContextDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AsyncPaymentsContextDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DNSResolverContextDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DNSResolverContextDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DNSResolverContextDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DNSResolverContextDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DNSResolverContextDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DNSResolverContextDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DNSResolverContextDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: APIError_free @@ -23415,6 +24535,22 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_verify JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KVStore_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: MigratableKVStore_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MigratableKVStore_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: migrate_kv_store_data + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_migrate_1kv_1store_1data + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: Persister_free @@ -23479,6 +24615,70 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1cle JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorUpdatingPersister_1as_1Persist (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: MonitorName_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorName_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: MonitorName_new + * Signature: (Ljava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorName_1new + (JNIEnv *, jclass, jstring); + +/* + * Class: org_ldk_impl_bindings + * Method: MonitorName_as_str + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_MonitorName_1as_1str + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: UpdateName_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateName_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: UpdateName_get_a + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateName_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: UpdateName_set_a + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateName_1set_1a + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: UpdateName_new + * Signature: (Ljava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateName_1new + (JNIEnv *, jclass, jstring); + +/* + * Class: org_ldk_impl_bindings + * Method: UpdateName_as_str + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_UpdateName_1as_1str + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ShortChannelIdError_clone @@ -25047,22 +26247,6 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1i JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1intercept_1htlcs (JNIEnv *, jclass, jlong, jboolean); -/* - * Class: org_ldk_impl_bindings - * Method: UserConfig_get_accept_mpp_keysend - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1mpp_1keysend - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: UserConfig_set_accept_mpp_keysend - * Signature: (JZ)V - */ -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 @@ -25082,10 +26266,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1manually_1han /* * Class: org_ldk_impl_bindings * Method: UserConfig_new - * Signature: (JJJZZZZZZ)J + * Signature: (JJJZZZZZ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1new - (JNIEnv *, jclass, jlong, jlong, jlong, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean); + (JNIEnv *, jclass, jlong, jlong, jlong, jboolean, jboolean, jboolean, jboolean, jboolean); /* * Class: org_ldk_impl_bindings @@ -26058,10 +27242,10 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and /* * Class: org_ldk_impl_bindings * Method: ChannelMonitor_process_pending_events - * Signature: (JJ)J + * Signature: (JJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1process_1pending_1events - (JNIEnv *, jclass, jlong, jlong); + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -26193,10 +27377,10 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1spe /* * Class: org_ldk_impl_bindings - * Method: ChannelMonitor_is_fully_resolved - * Signature: (JJ)Z + * Method: ChannelMonitor_check_and_update_full_resolution_status + * Signature: (JJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1is_1fully_1resolved +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1check_1and_1update_1full_1resolution_1status (JNIEnv *, jclass, jlong, jlong); /* @@ -26418,10 +27602,10 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InboundHTLCErr_1eq /* * Class: org_ldk_impl_bindings * Method: peel_payment_onion - * Signature: (JJJIZZ)J + * Signature: (JJJIZ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_peel_1payment_1onion - (JNIEnv *, jclass, jlong, jlong, jlong, jint, jboolean, jboolean); + (JNIEnv *, jclass, jlong, jlong, jlong, jint, jboolean); /* * Class: org_ldk_impl_bindings @@ -26466,10 +27650,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PendingHTLCRouting_1receive /* * Class: org_ldk_impl_bindings * Method: PendingHTLCRouting_receive_keysend - * Signature: (J[BJI[JZ)J + * Signature: (J[BJI[JZZ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PendingHTLCRouting_1receive_1keysend - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jint, jlongArray, jboolean); + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jint, jlongArray, jboolean, jboolean); /* * Class: org_ldk_impl_bindings @@ -26751,6 +27935,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedFailure_1hash JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedFailure_1eq (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Verification_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Verification_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: UnauthenticatedReceiveTlvs_as_Verification + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1as_1Verification + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: FailureCode_free @@ -27018,10 +28218,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone /* * Class: org_ldk_impl_bindings * Method: ChannelManager_new - * Signature: (JJJJJJJJJJI)J + * Signature: (JJJJJJJJJJJI)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jint); + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jint); /* * Class: org_ldk_impl_bindings @@ -27119,14 +28319,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1without_1broadcasting_1txn (JNIEnv *, jclass, jlong, jstring); -/* - * Class: org_ldk_impl_bindings - * Method: ChannelManager_send_payment_with_route - * Signature: (JJ[BJ[B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment_1with_1route - (JNIEnv *, jclass, jlong, jlong, jbyteArray, jlong, jbyteArray); - /* * Class: org_ldk_impl_bindings * Method: ChannelManager_send_payment @@ -27135,6 +28327,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment (JNIEnv *, jclass, jlong, jbyteArray, jlong, jbyteArray, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelManager_send_payment_for_bolt12_invoice + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment_1for_1bolt12_1invoice + (JNIEnv *, jclass, jlong, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelManager_abandon_payment @@ -27146,17 +28346,9 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1abandon_1payme /* * Class: org_ldk_impl_bindings * Method: ChannelManager_send_spontaneous_payment - * Signature: (JJJJ[B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: ChannelManager_send_spontaneous_payment_with_retry * Signature: (JJJ[BJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment_1with_1retry +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment (JNIEnv *, jclass, jlong, jlong, jlong, jbyteArray, jlong, jlong); /* @@ -27311,6 +28503,126 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inbou JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inbound_1channel_1from_1trusted_1peer_10conf (JNIEnv *, jclass, jlong, jlong, jbyteArray, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelManager_signer_unblocked + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1signer_1unblocked + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelManager_create_bolt11_invoice + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1bolt11_1invoice + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceParameters_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceParameters_get_amount_msats + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1get_1amount_1msats + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceParameters_set_amount_msats + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1set_1amount_1msats + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceParameters_get_description + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1get_1description + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceParameters_set_description + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1set_1description + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceParameters_get_invoice_expiry_delta_secs + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1get_1invoice_1expiry_1delta_1secs + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceParameters_set_invoice_expiry_delta_secs + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1set_1invoice_1expiry_1delta_1secs + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceParameters_get_min_final_cltv_expiry_delta + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1get_1min_1final_1cltv_1expiry_1delta + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceParameters_set_min_final_cltv_expiry_delta + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1set_1min_1final_1cltv_1expiry_1delta + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceParameters_get_payment_hash + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1get_1payment_1hash + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceParameters_set_payment_hash + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1set_1payment_1hash + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceParameters_new + * Signature: (JJJJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1new + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceParameters_default + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceParameters_1default + (JNIEnv *, jclass); + /* * Class: org_ldk_impl_bindings * Method: ChannelManager_create_offer_builder @@ -27343,6 +28655,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1pay_1for_1off JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1request_1refund_1payment (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelManager_pay_for_offer_from_human_readable_name + * Signature: (JJJ[BJJ[J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1pay_1for_1offer_1from_1human_1readable_1name + (JNIEnv *, jclass, jlong, jlong, jlong, jbyteArray, jlong, jlong, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: ChannelManager_create_inbound_payment @@ -27511,6 +28831,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1OffersMes JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1AsyncPaymentsMessageHandler (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelManager_as_DNSResolverMessageHandler + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1DNSResolverMessageHandler + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelManager_as_NodeIdLookUp @@ -27735,6 +29063,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1router (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelManagerReadArgs_get_message_router + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1message_1router + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelManagerReadArgs_set_message_router + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1message_1router + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelManagerReadArgs_get_logger @@ -27770,10 +29114,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1d /* * Class: org_ldk_impl_bindings * Method: ChannelManagerReadArgs_new - * Signature: (JJJJJJJJJ[J)J + * Signature: (JJJJJJJJJJ[J)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlongArray); + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlongArray); /* * Class: org_ldk_impl_bindings @@ -29199,22 +30543,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1feerate_ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1feerate_1sat_1per_11000_1weight (JNIEnv *, jclass, jlong, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: ChannelDetails_get_balance_msat - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1balance_1msat - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: ChannelDetails_set_balance_msat - * Signature: (JJ)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1balance_1msat - (JNIEnv *, jclass, jlong, jlong); - /* * Class: org_ldk_impl_bindings * Method: ChannelDetails_get_outbound_capacity_msat @@ -29490,10 +30818,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1pending_1 /* * Class: org_ldk_impl_bindings * Method: ChannelDetails_new - * Signature: (JJJJJJJJJ[BJJJJJJJJJZZJZZJJJ[J[J)J + * Signature: (JJJJJJJJJ[BJJJJJJJJZZJZZJJJ[J[J)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jbyteArray, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jboolean, jboolean, jlong, jboolean, jboolean, jlong, jlong, jlong, jlongArray, jlongArray); + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jbyteArray, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jboolean, jboolean, jlong, jboolean, jboolean, jlong, jlong, jlong, jlongArray, jlongArray); /* * Class: org_ldk_impl_bindings @@ -29623,6 +30951,38 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelShutdownState_1read JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ExpandedKey_hash + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1hash + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ExpandedKey_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ExpandedKey_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ExpandedKey_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1eq + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: ExpandedKey_new @@ -36255,6 +37615,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FinalOnionHopData_1clone_1ptr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FinalOnionHopData_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: FinalOnionHopData_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_FinalOnionHopData_1eq + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: OnionPacket_free @@ -37375,6 +38743,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1O JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1AsyncPaymentsMessageHandler (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: IgnoringMessageHandler_as_DNSResolverMessageHandler + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1DNSResolverMessageHandler + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: IgnoringMessageHandler_as_CustomOnionMessageHandler @@ -39279,118 +40655,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1commitment_1transaction_1number_1obscure_1factor (JNIEnv *, jclass, jbyteArray, jbyteArray, jboolean); -/* - * Class: org_ldk_impl_bindings - * Method: InitFeatures_write - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: InitFeatures_read - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_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 - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read - (JNIEnv *, jclass, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: NodeFeatures_write - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: NodeFeatures_read - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1read - (JNIEnv *, jclass, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_write - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1write - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11InvoiceFeatures_read - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1read - (JNIEnv *, jclass, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_write - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1write - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt12InvoiceFeatures_read - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1read - (JNIEnv *, jclass, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: BlindedHopFeatures_write - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1write - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: BlindedHopFeatures_read - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1read - (JNIEnv *, jclass, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_write - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_read - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read - (JNIEnv *, jclass, jbyteArray); - /* * Class: org_ldk_impl_bindings * Method: ShutdownScript_free @@ -39687,14 +40951,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelId_1write JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelId_1read (JNIEnv *, jclass, jbyteArray); -/* - * Class: org_ldk_impl_bindings - * Method: ChannelId_to_str - * Signature: (J)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ChannelId_1to_1str - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: create_phantom_invoice @@ -39714,49 +40970,41 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1wit /* * Class: org_ldk_impl_bindings * Method: create_invoice_from_channelmanager - * Signature: (JJJLorg/ldk/enums/Currency;JLjava/lang/String;IJ)J + * Signature: (JJLjava/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); + (JNIEnv *, jclass, jlong, jlong, jstring, jint, jlong); /* * Class: org_ldk_impl_bindings * Method: create_invoice_from_channelmanager_with_description_hash - * Signature: (JJJLorg/ldk/enums/Currency;JJIJ)J + * Signature: (JJJIJ)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); + (JNIEnv *, jclass, jlong, 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 + * Method: create_invoice_from_channelmanager_with_description_hash_and_payment_hash + * Signature: (JJJI[BJ)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); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash_1and_1payment_1hash + (JNIEnv *, jclass, jlong, jlong, jlong, jint, jbyteArray, 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 + * Method: create_invoice_from_channelmanager_with_payment_hash + * Signature: (JJLjava/lang/String;I[BJ)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); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1payment_1hash + (JNIEnv *, jclass, jlong, jlong, jstring, jint, jbyteArray, 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: payment_parameters_from_zero_amount_invoice + * Method: payment_parameters_from_variable_amount_invoice * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_payment_1parameters_1from_1zero_1amount_1invoice +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_payment_1parameters_1from_1variable_1amount_1invoice (JNIEnv *, jclass, jlong, jlong); /* @@ -39887,78 +41135,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1onion JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1eq (JNIEnv *, jclass, jlong, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_parameter_error - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_path_parameter_error - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1parameter_1error - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_all_failed_resend_safe - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1resend_1safe - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_duplicate_payment - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1duplicate_1payment - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_partial_failure - * Signature: ([JJ[B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial_1failure - (JNIEnv *, jclass, jlongArray, jlong, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_eq - * Signature: (JJ)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1eq - (JNIEnv *, jclass, jlong, jlong); - /* * Class: org_ldk_impl_bindings * Method: Bolt12PaymentError_free @@ -40057,12 +41233,20 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1route_1not_ /* * Class: org_ldk_impl_bindings - * Method: ProbeSendFailure_sending_failed + * Method: ProbeSendFailure_parameter_error * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1sending_1failed +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1parameter_1error (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ProbeSendFailure_duplicate_probe + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbeSendFailure_1duplicate_1probe + (JNIEnv *, jclass); + /* * Class: org_ldk_impl_bindings * Method: ProbeSendFailure_eq @@ -40215,6 +41399,118 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Type_1clone JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Type_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_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 + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1read + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceFeatures_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceFeatures_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1read + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt12InvoiceFeatures_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt12InvoiceFeatures_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1read + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: BlindedHopFeatures_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BlindedHopFeatures_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1read + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read + (JNIEnv *, jclass, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: OfferId_free @@ -40585,10 +41881,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1supported_1quantity /* * Class: org_ldk_impl_bindings - * Method: Offer_signing_pubkey + * Method: Offer_issuer_signing_pubkey * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Offer_1signing_1pubkey +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Offer_1issuer_1signing_1pubkey (JNIEnv *, jclass, jlong); /* @@ -40639,29 +41935,13 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1valid_1quantity JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1expects_1quantity (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: Offer_request_invoice_deriving_payer_id - * Signature: (JJJ[B)J - */ -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: Offer_request_invoice_deriving_metadata - * Signature: (J[BJJ[B)J - */ -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: Offer_request_invoice - * Signature: (J[B[B)J + * Signature: (JJJ[B)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Offer_1request_1invoice - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray); + (JNIEnv *, jclass, jlong, jlong, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings @@ -40967,6 +42247,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1clone_1ptr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: UnsignedBolt12Invoice_payment_paths + * Signature: (J)[J + */ +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payment_1paths + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: UnsignedBolt12Invoice_created_at @@ -41095,6 +42383,14 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1m JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1supported_1quantity (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: UnsignedBolt12Invoice_issuer_signing_pubkey + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1issuer_1signing_1pubkey + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: UnsignedBolt12Invoice_payer_metadata @@ -41121,10 +42417,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1quanti /* * Class: org_ldk_impl_bindings - * Method: UnsignedBolt12Invoice_payer_id + * Method: UnsignedBolt12Invoice_payer_signing_pubkey * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1payer_1signing_1pubkey (JNIEnv *, jclass, jlong); /* @@ -41151,6 +42447,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1p JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedBolt12Invoice_1amount_1msats (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Bolt12Invoice_payment_paths + * Signature: (J)[J + */ +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payment_1paths + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Bolt12Invoice_created_at @@ -41279,6 +42583,14 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1message_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1supported_1quantity (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Bolt12Invoice_issuer_signing_pubkey + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1issuer_1signing_1pubkey + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Bolt12Invoice_payer_metadata @@ -41305,10 +42617,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1quantity /* * Class: org_ldk_impl_bindings - * Method: Bolt12Invoice_payer_id + * Method: Bolt12Invoice_payer_signing_pubkey * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Bolt12Invoice_1payer_1signing_1pubkey (JNIEnv *, jclass, jlong); /* @@ -41561,100 +42873,60 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceError_1read /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithExplicitPayerIdBuilder_free + * Method: InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithDerivedPayerIdBuilder_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithExplicitPayerIdBuilder_build + * Method: InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_build_and_sign * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1build +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1build_1and_1sign (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithExplicitPayerIdBuilder_chain + * Method: InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_chain * Signature: (JLorg/ldk/enums/Network;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1chain +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1chain (JNIEnv *, jclass, jlong, jobject); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithExplicitPayerIdBuilder_amount_msats + * Method: InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_amount_msats * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1amount_1msats +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1amount_1msats (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithExplicitPayerIdBuilder_quantity + * Method: InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_quantity * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1quantity +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1quantity (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithExplicitPayerIdBuilder_payer_note + * Method: InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_payer_note * Signature: (JLjava/lang/String;)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithExplicitPayerIdBuilder_1payer_1note +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1payer_1note (JNIEnv *, jclass, jlong, jstring); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1build_1and_1sign - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithDerivedPayerIdBuilder_chain - * Signature: (JLorg/ldk/enums/Network;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1chain - (JNIEnv *, jclass, jlong, jobject); - -/* - * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithDerivedPayerIdBuilder_amount_msats - * Signature: (JJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1amount_1msats - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithDerivedPayerIdBuilder_quantity - * Signature: (JJ)J + * Method: InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_sourced_from_human_readable_name + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1quantity +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerSigningPubkeyBuilder_1sourced_1from_1human_1readable_1name (JNIEnv *, jclass, jlong, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: InvoiceRequestWithDerivedPayerIdBuilder_payer_note - * Signature: (JLjava/lang/String;)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestWithDerivedPayerIdBuilder_1payer_1note - (JNIEnv *, jclass, jlong, jstring); - /* * Class: org_ldk_impl_bindings * Method: UnsignedInvoiceRequest_free @@ -41833,10 +43105,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1suppo /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_signing_pubkey + * Method: UnsignedInvoiceRequest_issuer_signing_pubkey * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1signing_1pubkey +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1issuer_1signing_1pubkey (JNIEnv *, jclass, jlong); /* @@ -41863,6 +43135,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1amount_1msats (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: UnsignedInvoiceRequest_has_amount_msats + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1has_1amount_1msats + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: UnsignedInvoiceRequest_invoice_request_features @@ -41881,10 +43161,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1quant /* * Class: org_ldk_impl_bindings - * Method: UnsignedInvoiceRequest_payer_id + * Method: UnsignedInvoiceRequest_payer_signing_pubkey * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1signing_1pubkey (JNIEnv *, jclass, jlong); /* @@ -41895,6 +43175,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1payer_1note (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: UnsignedInvoiceRequest_offer_from_hrn + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1offer_1from_1hrn + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: InvoiceRequest_chains @@ -41969,10 +43257,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1supported_1qu /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_signing_pubkey + * Method: InvoiceRequest_issuer_signing_pubkey * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1signing_1pubkey +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1issuer_1signing_1pubkey (JNIEnv *, jclass, jlong); /* @@ -41999,6 +43287,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1chain JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1amount_1msats (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceRequest_has_amount_msats + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1has_1amount_1msats + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: InvoiceRequest_invoice_request_features @@ -42017,10 +43313,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1quantity /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequest_payer_id + * Method: InvoiceRequest_payer_signing_pubkey * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1signing_1pubkey (JNIEnv *, jclass, jlong); /* @@ -42031,6 +43327,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1i JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1note (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceRequest_offer_from_hrn + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1offer_1from_1hrn + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: InvoiceRequest_respond_with @@ -42145,10 +43449,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1suppo /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_signing_pubkey + * Method: VerifiedInvoiceRequest_issuer_signing_pubkey * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1signing_1pubkey +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1issuer_1signing_1pubkey (JNIEnv *, jclass, jlong); /* @@ -42175,6 +43479,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1amount_1msats (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: VerifiedInvoiceRequest_has_amount_msats + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1has_1amount_1msats + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: VerifiedInvoiceRequest_invoice_request_features @@ -42193,10 +43505,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1quant /* * Class: org_ldk_impl_bindings - * Method: VerifiedInvoiceRequest_payer_id + * Method: VerifiedInvoiceRequest_payer_signing_pubkey * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1signing_1pubkey (JNIEnv *, jclass, jlong); /* @@ -42207,6 +43519,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1payer_1note (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: VerifiedInvoiceRequest_offer_from_hrn + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1offer_1from_1hrn + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: VerifiedInvoiceRequest_respond_with @@ -42255,6 +43575,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1write (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceRequest_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1read + (JNIEnv *, jclass, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: InvoiceRequestFields_free @@ -42265,18 +43593,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1free /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFields_get_payer_id + * Method: InvoiceRequestFields_get_payer_signing_pubkey * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1payer_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1payer_1signing_1pubkey (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceRequestFields_set_payer_id + * Method: InvoiceRequestFields_set_payer_signing_pubkey * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1payer_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1payer_1signing_1pubkey (JNIEnv *, jclass, jlong, jbyteArray); /* @@ -42311,13 +43639,29 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1pa JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1payer_1note_1truncated (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceRequestFields_get_human_readable_name + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1get_1human_1readable_1name + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceRequestFields_set_human_readable_name + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1set_1human_1readable_1name + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: InvoiceRequestFields_new - * Signature: ([BJJ)J + * Signature: ([BJJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFields_1new - (JNIEnv *, jclass, jbyteArray, jlong, jlong); + (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -42633,26 +43977,18 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missin /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_missing_signing_pubkey + * Method: Bolt12SemanticError_missing_issuer_signing_pubkey * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1signing_1pubkey +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1issuer_1signing_1pubkey (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_invalid_signing_pubkey + * Method: Bolt12SemanticError_unexpected_issuer_signing_pubkey * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1signing_1pubkey - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_unexpected_signing_pubkey - * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1signing_1pubkey +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1issuer_1signing_1pubkey (JNIEnv *, jclass); /* @@ -42705,10 +44041,10 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missin /* * Class: org_ldk_impl_bindings - * Method: Bolt12SemanticError_missing_payer_id + * Method: Bolt12SemanticError_missing_payer_signing_pubkey * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payer_1id +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1payer_1signing_1pubkey (JNIEnv *, jclass); /* @@ -42767,6 +44103,22 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missin JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1payment_1hash (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: Bolt12SemanticError_missing_signing_pubkey + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1signing_1pubkey + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt12SemanticError_invalid_signing_pubkey + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1invalid_1signing_1pubkey + (JNIEnv *, jclass); + /* * Class: org_ldk_impl_bindings * Method: Bolt12SemanticError_missing_signature @@ -42775,6 +44127,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpe JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1missing_1signature (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: Bolt12SemanticError_unexpected_human_readable_name + * Signature: ()Lorg/ldk/enums/Bolt12SemanticError; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Bolt12SemanticError_1unexpected_1human_1readable_1name + (JNIEnv *, jclass); + /* * Class: org_ldk_impl_bindings * Method: RefundMaybeWithDerivedMetadataBuilder_free @@ -42809,10 +44169,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadat /* * Class: org_ldk_impl_bindings - * Method: RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id + * Method: RefundMaybeWithDerivedMetadataBuilder_deriving_signing_pubkey * Signature: ([BJJJ[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1deriving_1payer_1id +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RefundMaybeWithDerivedMetadataBuilder_1deriving_1signing_1pubkey (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong, jbyteArray); /* @@ -42993,10 +44353,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Refund_1quantity /* * Class: org_ldk_impl_bindings - * Method: Refund_payer_id + * Method: Refund_payer_signing_pubkey * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1signing_1pubkey (JNIEnv *, jclass, jlong); /* @@ -44567,14 +45927,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: DefaultRouter_as_MessageRouter - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1MessageRouter - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: Router_free @@ -46514,9 +47866,17 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1historic /* * Class: org_ldk_impl_bindings * Method: ProbabilisticScorer_historical_estimated_payment_success_probability - * Signature: (JJJJJ)J + * Signature: (JJJJJZ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1historical_1estimated_1payment_1success_1probability + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jboolean); + +/* + * Class: org_ldk_impl_bindings + * Method: ProbabilisticScorer_live_estimated_payment_success_probability + * Signature: (JJJJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1live_1estimated_1payment_1success_1probability (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong); /* @@ -47903,29 +49263,13 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1release JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1free (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: HeldHtlcAvailable_get_payment_release_secret - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1get_1payment_1release_1secret - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: HeldHtlcAvailable_set_payment_release_secret - * Signature: (J[B)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1set_1payment_1release_1secret - (JNIEnv *, jclass, jlong, jbyteArray); - /* * Class: org_ldk_impl_bindings * Method: HeldHtlcAvailable_new - * Signature: ([B)J + * Signature: ()J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1new - (JNIEnv *, jclass, jbyteArray); + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings @@ -47951,29 +49295,13 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HeldHtlcAvailable_1clone JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1free (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: ReleaseHeldHtlc_get_payment_release_secret - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1get_1payment_1release_1secret - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: ReleaseHeldHtlc_set_payment_release_secret - * Signature: (J[B)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1set_1payment_1release_1secret - (JNIEnv *, jclass, jlong, jbyteArray); - /* * Class: org_ldk_impl_bindings * Method: ReleaseHeldHtlc_new - * Signature: ([B)J + * Signature: ()J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReleaseHeldHtlc_1new - (JNIEnv *, jclass, jbyteArray); + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings @@ -48063,6 +49391,334 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1wr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsMessage_1read (JNIEnv *, jclass, jbyteArray, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverMessageHandler_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DNSResolverMessageHandler_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverMessage_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverMessage_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverMessage_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverMessage_dnssecquery + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1dnssecquery + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverMessage_dnssecproof + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1dnssecproof + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverMessage_hash + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1hash + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverMessage_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1eq + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSSECQuery_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DNSSECQuery_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSSECQuery_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSSECQuery_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSSECQuery_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSSECQuery_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSSECQuery_hash + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSSECQuery_1hash + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSSECQuery_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DNSSECQuery_1eq + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSSECProof_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DNSSECProof_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSSECProof_get_proof + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DNSSECProof_1get_1proof + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSSECProof_set_proof + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DNSSECProof_1set_1proof + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSSECProof_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSSECProof_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSSECProof_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSSECProof_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSSECProof_hash + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSSECProof_1hash + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSSECProof_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DNSSECProof_1eq + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverMessage_is_known_type + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1is_1known_1type + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverMessage_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverMessage_read + * Signature: ([BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1read + (JNIEnv *, jclass, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverMessage_as_OnionMessageContents + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSResolverMessage_1as_1OnionMessageContents + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HumanReadableName_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HumanReadableName_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HumanReadableName_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HumanReadableName_hash + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1hash + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HumanReadableName_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1eq + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HumanReadableName_new + * Signature: (Ljava/lang/String;Ljava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1new + (JNIEnv *, jclass, jstring, jstring); + +/* + * Class: org_ldk_impl_bindings + * Method: HumanReadableName_from_encoded + * Signature: (Ljava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1from_1encoded + (JNIEnv *, jclass, jstring); + +/* + * Class: org_ldk_impl_bindings + * Method: HumanReadableName_user + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1user + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HumanReadableName_domain + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1domain + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HumanReadableName_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HumanReadableName_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HumanReadableName_1read + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: OMNameResolver_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OMNameResolver_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OMNameResolver_new + * Signature: (II)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OMNameResolver_1new + (JNIEnv *, jclass, jint, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: OMNameResolver_new_best_block + * Signature: (JII)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OMNameResolver_1new_1best_1block + (JNIEnv *, jclass, jlong, jint, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: OMNameResolver_resolve_name + * Signature: (J[BJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OMNameResolver_1resolve_1name + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OMNameResolver_handle_dnssec_proof_for_offer + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OMNameResolver_1handle_1dnssec_1proof_1for_1offer + (JNIEnv *, jclass, jlong, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OMNameResolver_handle_dnssec_proof_for_uri + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OMNameResolver_1handle_1dnssec_1proof_1for_1uri + (JNIEnv *, jclass, jlong, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: OnionMessenger_free @@ -48159,6 +49815,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ResponseInstruction_1clone_1p JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ResponseInstruction_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ResponseInstruction_into_instructions + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ResponseInstruction_1into_1instructions + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: MessageSendInstructions_free @@ -48650,18 +50314,18 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_peel_1onion_1message /* * Class: org_ldk_impl_bindings * Method: OnionMessenger_new - * Signature: (JJJJJJJJ)J + * Signature: (JJJJJJJJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new - (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 * Method: OnionMessenger_new_with_offline_peer_interception - * Signature: (JJJJJJJJ)J + * Signature: (JJJJJJJJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new_1with_1offline_1peer_1interception - (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 @@ -48951,6 +50615,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1c JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1offers (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ParsedOnionMessageContents_dnsresolver + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ParsedOnionMessageContents_1dnsresolver + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ParsedOnionMessageContents_custom @@ -49697,76 +51369,116 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1free /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_get_payment_secret + * Method: ReceiveTlvs_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ReceiveTlvs_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ReceiveTlvs_tlvs + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1tlvs + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: UnauthenticatedReceiveTlvs_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: UnauthenticatedReceiveTlvs_get_payment_secret * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1secret +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1get_1payment_1secret (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_set_payment_secret + * Method: UnauthenticatedReceiveTlvs_set_payment_secret * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1secret +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1set_1payment_1secret (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_get_payment_constraints + * Method: UnauthenticatedReceiveTlvs_get_payment_constraints * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1constraints +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1get_1payment_1constraints (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_set_payment_constraints + * Method: UnauthenticatedReceiveTlvs_set_payment_constraints * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1constraints +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1set_1payment_1constraints (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_get_payment_context + * Method: UnauthenticatedReceiveTlvs_get_payment_context * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1get_1payment_1context +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1get_1payment_1context (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_set_payment_context + * Method: UnauthenticatedReceiveTlvs_set_payment_context * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1set_1payment_1context +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1set_1payment_1context (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_new + * Method: UnauthenticatedReceiveTlvs_new * Signature: ([BJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1new +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1new (JNIEnv *, jclass, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_clone_ptr + * Method: UnauthenticatedReceiveTlvs_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReceiveTlvs_clone + * Method: UnauthenticatedReceiveTlvs_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: UnauthenticatedReceiveTlvs_authenticate + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1authenticate + (JNIEnv *, jclass, jlong, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: PaymentRelay_free @@ -49935,14 +51647,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentContext_1clone_1ptr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentContext_1clone (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: PaymentContext_unknown - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentContext_1unknown - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: PaymentContext_bolt12_offer @@ -49967,38 +51671,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentContext_1bolt12_1refun JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentContext_1eq (JNIEnv *, jclass, jlong, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: UnknownPaymentContext_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: UnknownPaymentContext_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: UnknownPaymentContext_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: UnknownPaymentContext_eq - * Signature: (JJ)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1eq - (JNIEnv *, jclass, jlong, jlong); - /* * Class: org_ldk_impl_bindings * Method: Bolt12OfferContext_free @@ -50127,6 +51799,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ForwardTlvs_1write JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReceiveTlvs_1write (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: UnauthenticatedReceiveTlvs_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnauthenticatedReceiveTlvs_1write + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: PaymentRelay_write @@ -50175,22 +51855,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PaymentContext_1write JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentContext_1read (JNIEnv *, jclass, jbyteArray); -/* - * Class: org_ldk_impl_bindings - * Method: UnknownPaymentContext_write - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1write - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: UnknownPaymentContext_read - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnknownPaymentContext_1read - (JNIEnv *, jclass, jbyteArray); - /* * Class: org_ldk_impl_bindings * Method: Bolt12OfferContext_write @@ -50511,6 +52175,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageContext_1clone JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageContext_1offers (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: MessageContext_async_payments + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageContext_1async_1payments + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: MessageContext_dnsresolver + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageContext_1dnsresolver + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: MessageContext_custom @@ -50562,10 +52242,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersContext_1outbound_1paym /* * Class: org_ldk_impl_bindings * Method: OffersContext_inbound_payment - * Signature: ([B)J + * Signature: ([BJ[B)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersContext_1inbound_1payment - (JNIEnv *, jclass, jbyteArray); + (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings @@ -50575,6 +52255,38 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersContext_1inbound_1payme JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OffersContext_1eq (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: AsyncPaymentsContext_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsContext_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: AsyncPaymentsContext_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsContext_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: AsyncPaymentsContext_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsContext_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: AsyncPaymentsContext_outbound_payment + * Signature: ([BJ[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsContext_1outbound_1payment + (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: MessageContext_write @@ -50607,6 +52319,102 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OffersContext_1write JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OffersContext_1read (JNIEnv *, jclass, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: AsyncPaymentsContext_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsContext_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: AsyncPaymentsContext_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AsyncPaymentsContext_1read + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverContext_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverContext_get_nonce + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1get_1nonce + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverContext_set_nonce + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1set_1nonce + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverContext_new + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1new + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverContext_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverContext_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverContext_hash + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1hash + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverContext_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1eq + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverContext_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DNSResolverContext_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DNSResolverContext_1read + (JNIEnv *, jclass, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: FundingInfo_free @@ -51295,6 +53103,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1invoi JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1invoice_1request_1rejected (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: PaymentFailureReason_blinded_path_creation_failed + * Signature: ()Lorg/ldk/enums/PaymentFailureReason; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1blinded_1path_1creation_1failed + (JNIEnv *, jclass); + /* * Class: org_ldk_impl_bindings * Method: PaymentFailureReason_eq @@ -51319,6 +53135,54 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1wr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1read (JNIEnv *, jclass, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: InboundChannelFunds_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InboundChannelFunds_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InboundChannelFunds_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InboundChannelFunds_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InboundChannelFunds_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InboundChannelFunds_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InboundChannelFunds_push_msat + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InboundChannelFunds_1push_1msat + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InboundChannelFunds_dual_funded + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InboundChannelFunds_1dual_1funded + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: InboundChannelFunds_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InboundChannelFunds_1eq + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: Event_free @@ -51362,18 +53226,18 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1funding_1tx_1broadcast /* * Class: org_ldk_impl_bindings * Method: Event_payment_claimable - * Signature: ([B[BJJJJJJJ)J + * Signature: ([B[BJJJJJJJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimable - (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong, jlong, jlong, jlong, jlong, jlong, jlong); + (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings * Method: Event_payment_claimed - * Signature: ([B[BJJ[JJJ)J + * Signature: ([B[BJJ[JJJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed - (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong, jlong, jlongArray, jlong, jlong); + (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong, jlong, jlongArray, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -51466,10 +53330,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs /* * Class: org_ldk_impl_bindings * Method: Event_payment_forwarded - * Signature: (JJJJJJZJ)J + * Signature: (JJJJ[B[BJJZJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jboolean, jlong); + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jbyteArray, jbyteArray, jlong, jlong, jboolean, jlong); /* * Class: org_ldk_impl_bindings @@ -51490,10 +53354,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1channel_1ready /* * Class: org_ldk_impl_bindings * Method: Event_channel_closed - * Signature: (J[BJ[BJJ)J + * Signature: (J[BJ[BJJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1channel_1closed - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jbyteArray, jlong, jlong); + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jbyteArray, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -54727,6 +56591,70 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1sh JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1shutdown_1anysegwit (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_dual_fund_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1dual_1fund_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_dual_fund_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1dual_1fund_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_dual_fund + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1dual_1fund + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_dual_fund_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1dual_1fund_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_dual_fund_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1dual_1fund_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_dual_fund + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1dual_1fund + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_dual_fund + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1dual_1fund + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_dual_fund + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1dual_1fund + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: InitFeatures_set_taproot_optional @@ -55279,6 +57207,30 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1set_1tr JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1supports_1trampoline_1routing (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Bolt12InvoiceFeatures_set_trampoline_routing_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1trampoline_1routing_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt12InvoiceFeatures_set_trampoline_routing_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1trampoline_1routing_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt12InvoiceFeatures_supports_trampoline_routing + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1supports_1trampoline_1routing + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: InitFeatures_requires_trampoline_routing @@ -55303,6 +57255,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1tr JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceFeatures_1requires_1trampoline_1routing (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Bolt12InvoiceFeatures_requires_trampoline_routing + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1trampoline_1routing + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_dns_resolution_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1dns_1resolution_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_dns_resolution_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1dns_1resolution_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_dns_resolution + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1dns_1resolution + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_dns_resolution + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1dns_1resolution + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: RoutingFees_free @@ -55735,6 +57727,14 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_FilesystemStore_1get_1data_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FilesystemStore_1as_1KVStore (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: FilesystemStore_as_MigratableKVStore + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FilesystemStore_1as_1MigratableKVStore + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: BackgroundProcessor_free @@ -55809,172 +57809,28 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1free /* * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_clone_ptr - * Signature: (J)J + * Method: Bolt11ParseError_eq + * Signature: (JJ)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1eq + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_clone + * Method: Bolt11ParseError_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_bech32_error + * Method: Bolt11ParseError_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1bech32_1error +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1clone (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_parse_amount_error - * Signature: (I)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1parse_1amount_1error - (JNIEnv *, jclass, jint); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_malformed_signature - * Signature: (Lorg/ldk/enums/Secp256k1Error;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1malformed_1signature - (JNIEnv *, jclass, jobject); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_bad_prefix - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1bad_1prefix - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_unknown_currency - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1unknown_1currency - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_unknown_si_prefix - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1unknown_1si_1prefix - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_malformed_hrp - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1malformed_1hrp - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_too_short_data_part - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1too_1short_1data_1part - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_unexpected_end_of_tagged_fields - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1unexpected_1end_1of_1tagged_1fields - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_description_decode_error - * Signature: (I)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1description_1decode_1error - (JNIEnv *, jclass, jint); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_padding_error - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1padding_1error - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_integer_overflow_error - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1integer_1overflow_1error - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_invalid_seg_wit_program_length - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1invalid_1seg_1wit_1program_1length - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_invalid_pub_key_hash_length - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1invalid_1pub_1key_1hash_1length - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_invalid_script_hash_length - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1invalid_1script_1hash_1length - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_invalid_recovery_id - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1invalid_1recovery_1id - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_invalid_slice_length - * Signature: (Ljava/lang/String;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1invalid_1slice_1length - (JNIEnv *, jclass, jstring); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_skip - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1skip - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: Bolt11ParseError_eq - * Signature: (JJ)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11ParseError_1eq - (JNIEnv *, jclass, jlong, jlong); - /* * Class: org_ldk_impl_bindings * Method: ParseOrSemanticError_free @@ -56063,6 +57919,62 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11Invoice_1clone JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11Invoice_1hash (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceDescription_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceDescription_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceDescription_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceDescription_direct + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1direct + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceDescription_hash + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1hash + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceDescription_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1eq + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Bolt11InvoiceDescription_to_str + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Bolt11InvoiceDescription_1to_1str + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: SignedRawBolt11Invoice_free @@ -57215,6 +59127,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Bolt11Invoice_1amount_1milli_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Description_1new (JNIEnv *, jclass, jstring); +/* + * Class: org_ldk_impl_bindings + * Method: Description_empty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Description_1empty + (JNIEnv *, jclass); + /* * Class: org_ldk_impl_bindings * Method: Description_into_inner diff --git a/src/main/jni/org_ldk_impl_bindings_LDKAsyncPaymentsContext.h b/src/main/jni/org_ldk_impl_bindings_LDKAsyncPaymentsContext.h new file mode 100644 index 00000000..6afb49f8 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKAsyncPaymentsContext.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKAsyncPaymentsContext */ + +#ifndef _Included_org_ldk_impl_bindings_LDKAsyncPaymentsContext +#define _Included_org_ldk_impl_bindings_LDKAsyncPaymentsContext +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKAsyncPaymentsContext + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAsyncPaymentsContext_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKBolt11InvoiceDescription.h b/src/main/jni/org_ldk_impl_bindings_LDKBolt11InvoiceDescription.h new file mode 100644 index 00000000..a944ce2a --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKBolt11InvoiceDescription.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKBolt11InvoiceDescription */ + +#ifndef _Included_org_ldk_impl_bindings_LDKBolt11InvoiceDescription +#define _Included_org_ldk_impl_bindings_LDKBolt11InvoiceDescription +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKBolt11InvoiceDescription + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBolt11InvoiceDescription_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKBolt11ParseError.h b/src/main/jni/org_ldk_impl_bindings_LDKBolt11ParseError.h deleted file mode 100644 index 80c8b6c4..00000000 --- a/src/main/jni/org_ldk_impl_bindings_LDKBolt11ParseError.h +++ /dev/null @@ -1,21 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_ldk_impl_bindings_LDKBolt11ParseError */ - -#ifndef _Included_org_ldk_impl_bindings_LDKBolt11ParseError -#define _Included_org_ldk_impl_bindings_LDKBolt11ParseError -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_ldk_impl_bindings_LDKBolt11ParseError - * Method: init - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBolt11ParseError_init - (JNIEnv *, jclass); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.h b/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.h new file mode 100644 index 00000000..296b7bea --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ */ + +#ifndef _Included_org_ldk_impl_bindings_LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ +#define _Included_org_ldk_impl_bindings_LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZOfferZZ + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZOfferZZ_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.h b/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.h new file mode 100644 index 00000000..9fff802b --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ */ + +#ifndef _Included_org_ldk_impl_bindings_LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ +#define _Included_org_ldk_impl_bindings_LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKCOption_C2Tuple_CVec_C2Tuple_HumanReadableNameThirtyTwoBytesZZStrZZ + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1CVec_1C2Tuple_1HumanReadableNameThirtyTwoBytesZZStrZZ_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ.h b/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ.h new file mode 100644 index 00000000..6ab5ec64 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ */ + +#ifndef _Included_org_ldk_impl_bindings_LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ +#define _Included_org_ldk_impl_bindings_LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKCOption_C2Tuple_DNSResolverMessageResponseInstructionZZ + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1DNSResolverMessageResponseInstructionZZ_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_PublicKeyChannelIdZZ.h b/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_PublicKeyChannelIdZZ.h new file mode 100644 index 00000000..7ff394a4 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_PublicKeyChannelIdZZ.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKCOption_C2Tuple_PublicKeyChannelIdZZ */ + +#ifndef _Included_org_ldk_impl_bindings_LDKCOption_C2Tuple_PublicKeyChannelIdZZ +#define _Included_org_ldk_impl_bindings_LDKCOption_C2Tuple_PublicKeyChannelIdZZ +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKCOption_C2Tuple_PublicKeyChannelIdZZ + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1PublicKeyChannelIdZZ_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKDNSResolverMessage.h b/src/main/jni/org_ldk_impl_bindings_LDKDNSResolverMessage.h new file mode 100644 index 00000000..0bd6103a --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKDNSResolverMessage.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKDNSResolverMessage */ + +#ifndef _Included_org_ldk_impl_bindings_LDKDNSResolverMessage +#define _Included_org_ldk_impl_bindings_LDKDNSResolverMessage +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKDNSResolverMessage + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDNSResolverMessage_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKInboundChannelFunds.h b/src/main/jni/org_ldk_impl_bindings_LDKInboundChannelFunds.h new file mode 100644 index 00000000..d09d5dab --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKInboundChannelFunds.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKInboundChannelFunds */ + +#ifndef _Included_org_ldk_impl_bindings_LDKInboundChannelFunds +#define _Included_org_ldk_impl_bindings_LDKInboundChannelFunds +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKInboundChannelFunds + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKInboundChannelFunds_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKPaymentSendFailure.h b/src/main/jni/org_ldk_impl_bindings_LDKPaymentSendFailure.h deleted file mode 100644 index 3bffa6a0..00000000 --- a/src/main/jni/org_ldk_impl_bindings_LDKPaymentSendFailure.h +++ /dev/null @@ -1,21 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_ldk_impl_bindings_LDKPaymentSendFailure */ - -#ifndef _Included_org_ldk_impl_bindings_LDKPaymentSendFailure -#define _Included_org_ldk_impl_bindings_LDKPaymentSendFailure -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_ldk_impl_bindings_LDKPaymentSendFailure - * Method: init - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentSendFailure_init - (JNIEnv *, jclass); - -#ifdef __cplusplus -} -#endif -#endif -- 2.39.5